If the two machines often have the action of the packet, such as the compiler to the publisher, or provide the tool to install the media machine to other machines, often log in need to enter a password is more troublesome, and the script also requires a password is not secure.
Is there a good way? There are, and very simple, the following sections easy to complete!
The popular Speaking
A machine needs to log on to the B machine often, then put a's public key to B, so B will know a, the next time a login B will not need to say hello
Specific steps
#1 Enter the $HOME/.ssh directory of a machine to view the *.pub file cat $HOME/.ssh/id_dsa.pub#2 Copy the content, enter the B machine, paste the copied content into the following file VI $HOME/.ssh/authorized_ Keys#3 to exit after saving. Then execute the SSH username @ip on the A machine and you can log in directly
Or
#1 Copy the public key of a host to Host B, you need to modify the path, you need to enter the password. (preferably do not directly overwrite the Authorized_keys file) SCP $HOME/.ssh/id_dsa.pub user name @ip:/$HOME/.ssh#2 into the B machine CD $HOME/.ssh; Cat id_ Dsa.pub >> authorized_keys#3 exit after saving. Then execute the SSH username @ip on the A machine and you can log in directly
The two methods are essentially the same, the difference is that one is copy, one is to read the file appended to the file content to another file, according to the actual situation and personal habits to choose.
Linux SSH Create password-free login public key