Copy your SSH keys from GitHub or GitLab

Last update: 5/22/2022

This is a useful alternative if you are not using your primary device or cannot use ssh-copy-id. Replace <username> with your GitHub or GitLab username.

GitHub ​

curl https://github.com/<username>.keys | tee -a ~/.ssh/authorized_keys

GitLab ​

curl https://gitlab.com/<username>.keys | tee -a ~/.ssh/authorized_keys