SSH key related

SSH key related

Tags
SSH
Git
Setup
Published
January 12, 2024
Author
  1. Generate a pair of ssh key
    1. ssh-keygen -t rsa -C "[your_email@example.com]"
      πŸ’‘
      To distinguish different keys, I would recommend to identify a specific name to the generated key, such as id_rsa_azure
  1. Check the public key
    1. cat ~/.ssh/[your_key_name].pub
Β 

For Remote Login

Write the content of public key to ~/.ssh/authorized_keys of the remote machine
vim ~/.ssh/authorized_keys
Β 

For GitHub Authentication

  1. Add the public key to settings β†’ Access β†’ SSH and GPG keys
  1. Add the private key to ssh agent
    1. eval "$(ssh-agent -s)"; ssh-add [path/to/your/private/key]
(Optional) Check availability
ssh -vT git@github.com
Β 
Done πŸ‘
Β