如何使用本地SSH代理?

时间:2017-04-20 08:46:32

标签: ssh

我只是尝试在我的Mac上使用多个ssh身份,这是我的设置

Host x
 HostName bitbucket.org
 IdentityFile ~/.ssh/id_rsa_x

Host y
 HostName bitbucket.org
 IdentityFile ~/.ssh/id_rsa_y

在主机上,一切正常,但x没有用,有人可以帮助我解决这个问题吗

1 个答案:

答案 0 :(得分:1)

两个条目的主机名相同。 还要检查.ssh文件夹中IdentityFile的文件权限。

如果这根本不起作用,请尝试使用以下命令调试ssh连接:

ssh -vvv user@host
OpenSSH_5.1p1, OpenSSL 0.9.8a 11 Oct 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to host [x.x.x.x] port 22.
debug1: Connection established.