1
Dashit 2016-09-28 09:24:05 +08:00
config 文件贴了看下。
|
2
higocn OP @Dashit config
Host git.mydomain.com Port 65422 HostName git.mydomain.com PreferredAuthentications publickey IdentityFile ~/.ssh/aaa_rsa Host github.com HostName github.com User myname PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa Host * IdentitiesOnly yes 我发现在公司两个都可以访问,在家就只有上边那个可以访问。 |
3
Dashit 2016-09-28 10:31:39 +08:00
@higocn 我也是用这种方法弄的。看日志像是 ssh key 的问题。 wifi 情况生成的 ssh key 连网线是不能用的。没有这种情况吧。
|
4
higocn OP @Dashit
我都是 wifi 生成的, key 应该没问题, 因为在公司网,两个都是正常访问的。只有在家里,是底下那个不能访问。 |
5
iCyMind 2016-09-28 11:12:10 +08:00
把私钥文件名改回 id_rsa 试试。
Tip: On most systems the default private keys (~/.ssh/id_rsa, ~/.ssh/id_dsa and ~/.ssh/identity) are automatically added to the SSH authentication agent. You shouldn't need to run ssh-add path/to/key unless you override the file name when you generate a key. https://help.github.com/articles/error-permission-denied-publickey/#make-sure-you-have-a-key-that-is-being-used |