Authentificate Without Entering Your Passphrase

If you work often on a specific remote computer, it is cumbersome to login and enter your passphrase every time. There is a simpler method which avoids entering your passphrase. Proceed as follows:

  1. Create your public and private key pair on your client first.

    1. Create your public and private key with the command:

      ssh-keygen -t rsa
    2. Use the default value and hit just Enter.

    3. Do not enter a passphrase.

  2. Copy your public key to your remote computer. Depending on which user do you want to work, you have the following options:

    • If the user on your client is the same than on your remote computer, use the following command:

      ssh-copy-id -i ~/.ssh/id_rsa.pub venus
    • If both users on client and remote computer are different, replace the placeholder REMOTE_USER with the corresponding username on your remote computer and use this command:

      ssh-copy-id -i ~/.ssh/id_rsa.pub REMOTE_USER@venus
  3. If you see the following message, answer with yes:

    The authenticity of host 'venus (192.168.0.1)' can't be established.
    RSA key fingerprint is 12:34:56:78:9a:bc:de:f0:12:34:56:78:9a:bc:de
    Are you sure you want to continue connecting (yes/no)?

    The fingerprint from the previous example is different on your computer.

  4. Enter the password for your remote user.

After you have executed the previous procedure successfully, you can login without any passphrase with the following command:

ssh venus

The same applies if you exported your public key for a different user:

ssh REMOTE_USER@venus