Knowledge Base - SSH

How to Setup Passwordless SSH Login — concise version

Setup SSH Passwordless Login

  1. Create ~/.ssh/config entry for remote machine.

  2. Check for existing SSH key pair.

    ls -al ~/.ssh/id_*.pub
  3. If necessary, generate a new SSH key pair.

    ssh-keygen -t rsa -b 4096

    Press Enter to accept the default file location and file name:

    Enter file in which to save the key (/home/yourusername/.ssh/id_rsa):

    Press Enter to leave passphrase empty:

    Enter passphrase (empty for no passphrase):
  4. Copy the public key

    ssh-copy-id remote_username@server_ip_address
    or
    ssh-copy-id ~/.ssh/config alias

    You will be prompted to enter the remote_username password.

  5. Login to your server using SSH keys

    After completing the steps above you should be able log in to the remote server without being prompted for a password.

    To test it just try to login to your server via SSH:

    ssh remote_username@server_ip_address