为没有密码的自动登录设置SSH

时间:2015-05-13 10:28:39

标签: ssh sshd

好吧,我有2台电脑拨打120和110.我正在尝试配置一个没有密码的ssh连接,从110到120.这就是我在120中所做的:

1- ssh-keygen -t rsa
2- scp ~/.ssh/id_rsa.pub root@110:.ssh/authorized_keys

然后在110:

1- chmod 700 ~/.ssh/authorized_keys

此步骤无法正常工作,因为它一直要求输入密码。所以,我尝试做相反的事情,从120到110并完成相同的工作。 我还更改了两台计算机的PermitRootLogin yes文件中的/etc/ssh/sshd_config

我没有想法。有什么建议吗?

编辑:

这是我使用ssh -vv:

debug2: we did not send a packet, disable method
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
root@192.168.1.120's password: 

1 个答案:

答案 0 :(得分:0)

尝试运行此项(生成密钥后):

ssh-add