Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring Local SSH Login with Public and Private Keys

Procedure

Configuring local SSH login with public and private keys (on Windows)

  1. Create a public-private key pair.

    On Windows, run ssh-keygen -b 3072 -t rsa in the CLI to create a public-private key pair. Press Enter to proceed. By default, the created public-private key pair is stored in the id_rsa and id_rsa.pub files in ~/.ssh/.

  2. Copy the local .ssh folder to the SSH server (the remote environment to be connected) and import the content of the public key file to the authorized_keys file.
    1
    2
    cd ~/.ssh
    cat id_rsa.pub >> authorized_keys
    
  3. Configure the directory permissions.
    • Set the permission for the SSH server user directory to 700.
      1
      chmod 700 ~
      
    • Set the permission for the .ssh directory to 700.
      1
      chmod 700 ~/.ssh
      
    • Set the permission for the authorized_keys file to 600.
      1
      chmod 600 ~/.ssh/authorized_keys