![Windows 10 上的 ssh 代理程式轉發](https://rvso.com/image/1595498/Windows%2010%20%E4%B8%8A%E7%9A%84%20ssh%20%E4%BB%A3%E7%90%86%E7%A8%8B%E5%BC%8F%E8%BD%89%E7%99%BC.png)
當我從已啟用的 macOS 用戶端透過 sshAgentForwarding
連線到 Windows 10 主機時,我無法存取主機上的用戶端金鑰。
Windows主機內建OpenSSH伺服器已AllowAgentForwarding
啟用。
此外,當我 ssh 到其他(非 Windows)主機時,代理轉送可以正常運作。
我是否缺少一些特殊技巧來讓代理轉發在 Windows 主機上工作,或者是什麼可能導致它無法運作。
調試日誌至少似乎表明它正在嘗試連接代理:
debug1: active: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: server_input_channel_req: channel 0 request auth-agent [email protected] reply 0
debug1: session_input_channel_req: session 0 req [email protected]
答案1
答案2
至少在Windows 11上,您可以使用SSH代理轉發,但您需要執行ssh驗證代理:
- 從“開始”功能表開啟“服務”應用程式。
- 向下捲動至“OpenSSH 身份驗證代理程式”。
- 右鍵單擊該服務以存取其“屬性”。將其“啟動類型”更改為“自動(延遲啟動)”。 “確定”儲存您的變更。
- 右鍵單擊該服務並從上下文選單中選擇“啟動”。
答案3
Windows 上預設會停用 SSH-Agent。
# By default the ssh-agent service is disabled. Allow it to be manually started for the next step to work.
# Make sure you're running [Powershell] as an Administrator.
Get-Service ssh-agent | Set-Service -StartupType Manual
# Start the service
Start-Service ssh-agent
# This should return a status of Running
Get-Service ssh-agent
# Now load your key files into ssh-agent
ssh-add ~\.ssh\id_ed25519