SSH Passwordless Login πŸ”

SSH Passwordless Login πŸ”#

  1. Generate an SSH key pair
    Run the following command on the Terminal app on macOs or Command Prompt/PowerShell on Windows:

    ssh-keygen -t rsa
    

    After running this, two files are created in your ~/.ssh directory:

    File

    Description

    id_rsa

    Your private key (keep this secure and never share it)

    id_rsa.pub

    Your public key (safe to share with servers)

  2. Copy the public key id_rsa.pub to KLC

    On macOS or Linux:

    • Run the following command on the Terminal:

      ssh-copy-id your_netid@klc0202.quest.northwestern.edu
      

    Add manually (work for all OS):

    • On your local machine, open id_rsa.pub in a text editor and copy its contents.

    • Open an SSH session to KLC, create the .ssh directory if it doesn’t exist:

      mkdir -p ~/.ssh
      
    • Then paste the contents of id_rsa.pub into the file:

      nano ~/.ssh/authorized_keys
      
  3. Update permission on KLC

    • Open an SSH session to KLC, update permission

      chmod 700 ~/.ssh
      chmod 600 ~/.ssh/authorized_keys