设置SSH以便在无密码的情况下自动登录
我有两台电脑,分别叫120和110。我正在尝试在110到120之间配置一个没有密码的ssh连接。这就是我在120中所做的:设置SSH以便在无密码的情况下自动登录,ssh,sshd,Ssh,Sshd,我有两台电脑,分别叫120和110。我正在尝试在110到120之间配置一个没有密码的ssh连接。这就是我在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,做完全相同的事情。 我还更改了两台计算机的/etc
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,做完全相同的事情。
我还更改了两台计算机的/etc/ssh/sshd\u config
文件中的permitrotlogin yes
我没有主意了。有什么建议吗
编辑:
这是我使用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:
尝试运行此操作(生成密钥后):
ssh-add