SSH 服务器不用密码

1 A: user a
ssh-keygen -t rsa
2 Created a directory on B, if ~/.ssh exists, which is fine.
a@A:~> ssh b@B mkdir -p .ssh
3 Append this to user b on B ~/.ssh/authorized_keys path.
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
4 a@A:~> ssh b@B hostname

 PS: may be you need these

  • Put the public key in .ssh/authorized_keys2
  • Change the permissions of .ssh to 700
  • Change the permissions of .ssh/authorized_keys2 to 640
原文地址:https://www.cnblogs.com/iosdev/p/3324104.html