- Make sure to install SSH
yum install openssh-clients
- You want to SSH from Server A to server B without a password
- First log in on A and generate a pair of authentication keys. Do not enter a passphrase:
ssh-keygen -t rsa
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub.
- Now use ssh to create a directory on the remote server ~/.ssh :
ssh root@B mkdir -p .ssh cat id_rsa.pub | ssh root@B 'cat >> .ssh/authorized_keys'