SSH 自动远程登陆

来源:互联网 发布:淘宝宝贝没有无线展现 编辑:程序博客网 时间:2024/06/05 05:02

1. 在client端使用ssh-keygen生成, public & private key

$ ssh-keygenEnter passphrase (empty for no passphrase):Enter same passphrase again:

Note: When it asks you to enter the passphrase just press enter key, and do not give any password here

2. 使用ssh-copy-id  copy public key (id_rsa.pub )到server端

ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.200.10

Note: The above will ask the password for your account on the remote host, and copy the public key automatically to the appropriate location. If ssh-copy-id doesn’t work for you, use the method we discussed earlier to setup ssh password less login.

 

3. 可以实现自动远程登陆