$ ssh-keygen -C 'your.email@provider.com' -f $HOME/.ssh/user-github -t ed25519-sk
Generating public/private ed25519-sk key pair.
You may need to touch your authenticator to authorize key generation.
Enter PIN for authenticator: ****************
You may need to touch your authenticator (again) to authorize key generation.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/$USER/.ssh/user-github
Your public key has been saved in /home/$USER/.ssh/user-github.pub
The key fingerprint is:
SHA256: <hash> your.email@provider.com
It is probably more convenient to use an empty passphrase.
$ xclip -i -sel clip < $HOME/.ssh/user-github.pub
Go to https://github.com/settings/keys, click on New SSH key
and paste key and save
Host github.com
Hostname ssh.github.com
Port 443
User git
IdentityFile %d/.ssh/user-github
IdentitiesOnly yes
$ ssh -T git@github.com
Confirm user presence for key ED25519-SK SHA256: <hash>
Hi user! You've successfully authenticated, but GitHub does not provide shell access.
$ git remote set-url origin git@github.com:username/your-repository.git
$ git remote show origin
Confirm user presence for key ED25519-SK SHA256: <hash>
* remote origin
Fetch URL: git@github.com:username/your-repository.git
Push URL: git@github.com:username/your-repository.git
HEAD branch: main
Remote branch:
main tracked
Local branch configured for 'git pull':
main merges with remote main
Local ref configured for 'git push':
main pushes to main (up to date)