SSH 自動遠端登陸

jackie_gnu發表於2011-07-27

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

$ ssh-keygen
Enter 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. 可以實現自動遠端登陸

 

相關文章