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

posted on 2013-09-16 13:35  小浪鼓  阅读(287)  评论(0编辑  收藏  举报

导航