The following Tutorial walks you through how to setup authentication using a key pair to negotiate the connection, stopping the requirement for passwords.

1.First, create a public/private key pair on the client that you will use to connect to the server (you will need to do this from each client machine from which you connect):

ssh-keygen -t rsa

Leave the passphrase blank if you dont want to receive a prompt for this.

This will create two files in your ~/.ssh directory called: id_rsa and The first: id_rsa is your private key and the second: is your public key.

  1. Now set permissions on your private key:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
  1. Copy the public key ( to the server and install it to the authorized_keys list:
cat >> ~/.ssh/authorized_keys


Once you’ve imported the public key, you can delete it from the server.

  1. Set file permissions on the server:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

The above permissions are required if StrictModes is set to yes in /etc/ssh/sshd_config (the default).

  1. Ensure the correct SELinux contexts are set:
restorecon -Rv ~/.ssh

Now when you login to the server you shouldn’t be prompted for a password (unless you entered a passphrase). By default, ssh will first try to authenticate using keys. If no keys are found or authentication fails, then ssh will fall back to conventional password authentication.


If you want access to and from some servers you would need to complete this process on each “client setver” and “master server”

If you have any issues with setting this up, please let me know over on my Discord.