Skip to content

Instantly share code, notes, and snippets.

@cy-park
Last active August 24, 2021 05:14
Show Gist options
  • Save cy-park/e0a7caffa7c02e9c026bf8992eb7ff5e to your computer and use it in GitHub Desktop.
Save cy-park/e0a7caffa7c02e9c026bf8992eb7ff5e to your computer and use it in GitHub Desktop.

SSH RSA Key Generation

Mac

ssh-keygen -t rsa -b 4096 -C "<email_address>"
pbcopy < ~/.ssh/id_rsa.pub

WSL

ssh-keygen -t rsa -b 4096 -C "<email_address>"
cat ~/.ssh/id_rsa.pub | clip.exe

~/.ssh/config

# GitHub
  Host host_alias
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa
  AddKeysToAgent yes
  # UseKeychain yes

Adding SSH key to ssh-agent

Mac

eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/id_rsa

WSL

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

Adding to knwon_hosts

ssh -i ~/.ssh/id_rsa username@github.com

Changing Passphrase

ssh-keygen -p -f ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment