To enable access to a remote host requiring a password, follow this procedure:

1. Generate SSH keys in the local host

# ssh-keygen -t rsa -b 2048 -N ''

This command generates 2 keys: a private (id_rsa) and a public (

2. Install the public key in the remote host

To do this, append the contents of to ~/.ssh/authorized_keys in the remote server. You can do this using the commands below:

# ssh user@remote "test -d ~/.ssh || mkdir ~/.ssh && chmod 700 ~/.ssh"
# cat ~/ | ssh user@remote "cat >> ~/.ssh/authorized_keys"

NOTE: The above commands will ask you for user’s password.

After completing both steps, you will be able to connect via ssh without asking for password using the following command:

# ssh user@remote