2.21.6.1. Setting up Keyfile-based Passwordless Authentication

The SSH remote profile requires passwordless keyfile authentication to the remote server. The configuration of this authentication method is different depending on the operating system and SSH server used.

Configuration Steps
  1. Open a command prompt.

  2. Generate an SSH key pair. To do this, type:

    ssh-keygen
  3. At the prompt, select a location to save the key pair. The default location is usually fine, so press Enter.

  4. When prompted to enter a passphrase for the key, skip this step to set up passwordless authentication.

  5. You must copy the public key to the remote server you want to connect to. To do this, type the following command and press Enter, replacing user and server with your own username and server information:

    ssh-copy-id user@server

    Note:   You can manually copy the public key to the remote server. To do this:

    1. Navigate to the user's directory on the remote machine.

    2. Create the .ssh folder if it does not exist.

    3. Create a file called authorized_keys and paste the contents of your public key file into it or append it if the file already exists.


  6. At the prompt, enter your password for the remote server.

    The public key is copied to the remote server.

  7. Test the connection by typing the following command and pressing Enter, replacing user and server with your own username and server information:

    ssh user@server

    If everything is set up correctly, you can connect to the remote server without entering a password.

Troubleshooting

If the passwordless login does not work after following these steps, try the following:

  1. Check the sshd_config file (Linux: /etc/ssh/sshd_config, Windows: C:/ProgramData/ssh/sshd_config).

    1. Consult your IT before making modifications to this file.

    2. Set PubkeyAuthentication to yes.

    3. Make sure the AuthorizedKeysFile path is correct .

    4. Set StrictModes to no.

  2. Make sure the SSH server is running on the remote. Check that it is possible to use a standard SSH connection with a username and password. If not, the SSH server is not set up correctly.