[user01@server1 ~]$ ssh-copy-id -i .ssh/id_rsa.pub user01@server2.example.com
The authenticity of host 'server2.example.com (192.168.1.20)' can't be established.
RSA key fingerprint is 82:62:75:f9:80:06:58:91:ec:71:12:c1:4c:ce:d9:9b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'server2.example.com,192.168.1.20' (RSA) to the list of known hosts.
user01@server2.example.com's password:
Now try logging into the machine, with "ssh 'user01@server2.example.com'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.

On the server2, edit the /etc/ssh/sshd_config file and set the following options: