大网数据广告活动
服务器运维问答

SSH forwarding (SSH_AUTH_SOCK) on Windows

· 52CE 我爱测

Does anyone use SSH forwarding on Windows? It says it should set up SSH_AUTH_SOCK env var. But this variable is empty. If I run start-ssh-agent command it shows: Found ssh-agent at 3356 Found ssh-agent socket at /tmp/ssh-z8A7Sq09…

问题原文

原帖链接 · WHITECOLOR · CC BY-SA 3.0

Does anyone use SSH forwarding on Windows?

It says it should set up SSH_AUTH_SOCK env var. But this variable is empty.

If I run start-ssh-agent command it shows:

Found ssh-agent at 3356
Found ssh-agent socket at /tmp/ssh-z8A7Sq092g3X/agent.10484
Identity added: /c/Users/user/.ssh/id_rsa (/c/Users/user/.ssh/id_rsa)

%SSH_AUTH_SOCK% is available in this shell, but is not available in other shells.

I'm trying to forward SSH to a Docker container.

Does forwarding work for you even to some servers?

已采纳解答

原帖链接 · Jakuje · CC BY-SA 3.0

%SSH_AUTH_SOCK% is available in this shell, but is not available in other shells.

Environment variables are per-shell, therefore it is not available in the other shells, unless you start them from the first one. This is feature.

I'm trying to forward SSH to a Docker container.

To forward ssh-agent authentication socket, you need to use -A switch to ssh or ForwardAgent option in ssh_config.

Does forwarding work for you even to some servers?

Yes, it does!

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-08-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。