Child pages
  • How-To: SSH via Public Key Authentication PKA

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. SSH to the remote machine: 

    Code Block
    ssh igpp@<remotemachine><username>@<remotemachine>


  2. Then confirm the remote machine has a ".ssh" folder in your account's home directory: 

    Code Block
    ls -la ~


  3. If it does not, create the .ssh folder: 

    Code Block
    mkdir ./.ssh


  4. Make sure that directory is accessible only to your account: 

    Code Block
    chmod 700 ./.ssh


  5. Now copy your public key to the remote machine, from the machine you created the keys on: 

    Code Block
    scp .ssh/id_rsa.pub igpp@<remotemachine><username>@<remotemachine>:~/.ssh/<hostmachinename>.pub

    where <hostmachinename> will help identify the source of the public key. 

  6. Now SSH into the remote machine you have copied the file to, and cd to the .ssh directory in your home directory: 

    Code Block
    cd .ssh


  7. You'll see the <hostmachinename>.pub file you just copied over. Add its contents to a file named "authorized_keys": 

    Code Block
    cat <hostmachinename>.pub >> authorized_keys


  8. Back on the host machine, test SSH:

    Code Block
    ssh igpp@<remotemachine><username>@<remotemachine>

    which should result in a login without a password. 

  9. Repeat for every remote machine.