for root user
- [root@A ~]vi /etc/hosts
#[IP address] [hostname]
192.168.1.X A
192.168.1.Y B
- generate authentication keys and distribute
[root@A ~]# ssh-keygen -t rsa
[root@A ~]# cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
[root@A ~]# scp ~/.ssh/* root@B:~/.ssh/
- check
[root@A ~]# ssh B
[root@A ~]# ssh A
for non-root users
- just like what has to do for root user