How To Create SSH Keys For Authentication

Overview

Creating and using SSH keys for authentication requires 3 minimum steps

  1. Generate Your Public-Private Key Pair
  2. Transfer Your Public Key To The Remote Host(s)
  3. Test Your Private Key

Commands To Run:

ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub user1@remotehost
ssh user1@remotehost

Demonstration

Here’s my YouTube short explaining this process:

And here’s a long form video demonstrating this process:

TBA

Extra Information

  • SSH key authentication uses asymmetric encryption:
    • Public Key encrypts
    • Private Key decrypts
  • Your Public Key is safe to give to anyone, anywhere. Hence it’s name.
  • Your Private Key must be safeguarded.
    • If any copies exist, assume your identity is compromised and refresh your key pair.

Leave a comment