是不是生成的id_rsa.pub都放在远程服务器的~/.ssh/authorized_keys下就可以了?我有一台是成功的,可是另一台怎么都不行,非要输密码,请问这是什么情况?
2 回答

慕容森
TA贡献1853条经验 获得超18个赞
放在「~/.ssh/authorized_keys下」?应该是放它里边。它应该是个文件,一行一个公钥。授权失败的话,请检查系统日志。另外注意~/.ssh的权限应该是700,当然所有者也不能错。

互换的青春
TA贡献1797条经验 获得超6个赞
首先使用ssh-i/path/to/keyfileuser@host1和host2-vvvv,分别查看你能否登录这两台机器以及成功使用的keyfile....debug1:Tryingprivatekey:/Users/xxx/.ssh/host1.pemdebug1:readPEMprivatekeydone:typeRSAdebug3:sign_and_send_pubkey:RSA30:a9:37:b5:c4:ad:8a:b4:c8:64:f7:fb:c1:7d:48:62debug2:wesentapublickeypacket,waitforreplydebug1:Authenticationsucceeded(publickey).Authenticatedtohost1....fabricfromfabric.apiimport*env.hosts=['host1','host2']env.user='user'env.key_filename='/path/to/keyfile.pem'run('uname-a')
添加回答
举报
0/150
提交
取消