Generate key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# better, more modern:
ssh-keygen -t ed25519 -C "your_email@example.com"
Check correct file permissions
stat -c '%a %n' ~/.ssh ~/.ssh/*
should output something like:
700 /home/[username]/.ssh
600 /home/[username]/.ssh/id_rsa
644 /home/[username]/.ssh/id_rsa.pub
644 /home/[username]/.ssh/known_hosts
Copy to clipboard
copy
is e.g. xclip -sel clip
cat ~/.ssh/id_rsa.pub | copy
Check fingerprint
to compare with the one saved in an online service
ssh-add -l -E md5
Test connection to Github
ssh -T git@github.com