【发布时间】:2022-01-27 11:34:48
【问题描述】:
我想通过 Ubuntu20.04 服务器 U2 访问 Ubuntu20.04 服务器 U1,因为 U1 位于防火墙后面,来自带有 BugSur 的 MacBook。从 U2 到 U1 的 SSH 使用公钥完成,无需密码。我使用密码到达U2,但下一步总是要求输入密码(我现在不记得了)。我见过this question 并在MacBook 的.ssh/config 中尝试过这样的事情:
Host U2
HostName accessible.uni.com
User me
# PreferredAuthentications publickey
ForwardX11 yes
Host U1
HostName behind_firewall.uni.com
User me
# PreferredAuthentications publickey
# IdentityFile /home/me/.ssh/id_rsa.pub
ProxyJump U2
ForwardX11 yes
并运行ssh U1 输入U2 的密码,但随后要求输入U1 的密码。如何让它在第二个 ssh 上免密码运行?
【问题讨论】:
-
你可以使用RemoteCommand Example
-
您能否在笔记本电脑上运行身份验证代理,将您的密钥加载到代理中并使用
-A选项转发连接?
标签: ssh openssh public-key