eg:
A:192.168.113.181
B:192.168.113.182
Perform the following on host A:
1.
$ssh-keygen -t rsa -P ''-------------------- Then keep pressing the Enter key, and the generated key will be saved in the .ssh/id_rsa file according to the default option
2.
ssh-copy-id -i id_rsa.pub [email protected]
Just two simple steps, you can achieve it!
Test it:
[root@localhost .ssh]# ssh 192.168.113.182 Last login: Tue Jan 5 14:48:10 2016 from 192.168.113.181