Premise needs to close iptables and SELinux
1. Open the ssh configuration files, enable the following options
vim / etc / ssh / sshd_config
RSAAuthentication yes # Allow RSA authentication
PubkeyAuthentication yes # allow public key authentication
AuthorizedKeysFile .ssh / authorized_keys # public storage address
#PermitRootLogin Yes if you want to log in as root ssh trust, the project must not enable this option
2, restart the ssh service
3, to generate public and private key:
ssh-keygen -t rsa -P ""
-P The password, -P "" says a null password, you can not have -P parameter, this three vehicles will enter, with -P to a carriage return.
The default in ~ / .ssh directory two files are generated, private and public id_rsa id_rsa.pub.
4, import public key to the certification documents, change permissions
2.1 into native authorized_keys file (as a backup)
cat ~ / .ssh / id_rsa.pub >> ~ / .ssh / authorized_keys
2.2 To Free password into the server's authorized_keys file
First, copy the public key to the server
scp ~ / .ssh / id_rsa.pub xxx @ host: /home/id_rsa.pub
Then, the public key into the certificate file (this step of the operation on the other server)
Shell Code: cat /home/id_rsa.pub >> ~ / .ssh / authorized_keys
2.3 Change permissions on the server
chmod 700 ~ / .ssh
chmod 600 ~ / .ssh / authorized_keys
5, the test landing
If the port is not the default ssh, ssh command when you want to add -p port number
ssh -p 10000 192.168.111.111
6. Disconnect ssh landing
7, across multiple servers ssh mutual trust, just do more of the same operating only on multiple servers.