Add keygen to avoid prompting for password while running ssh command.
Type ssh-keygen –t rsa command at Server
When asked to save the file just press enter
[root@ServerHostname .ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
#by default the key is saved in /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.
The key fingerprint is:
there are two methods to add the key to client choose whichever is suited to you.
Then ssh the id_rsa.pub file to remote server with the name as authorized_keys.
scp -p /root/.ssh/id_rsa.pub root@HOSTNAME:/root/.ssh/authorized_keys
Run following command from Server.
# ssh-copy-id -i /root/.ssh/id_rsa.pub root@ClientHOst/IP
enter password for client machine.
run SSH clientHOST/IP
You should be able to get the terminal of client without asking for any password.