Another way to authenticate with GitHub is via an SSH key. The key is generated on your local machine and installed on GitHub. It has all the permissions of your regular account and is the typical way remote servers are accessed. The rest of this guide will show how to generate and set up an SSH key and use it with GitHub.
Note If you use 1Password, then there is even an easier way to generate and install an SSH key at GitHub and to install an SSH Signing Key at GitHub. If you use 1Password Business at work, you are eligible for a [free, separate 1Password Families membership](https://support.1password.com/link-family/.
Create an SSH key:
If you are on Ubuntu and the above command fails, you may have to install the ssh package:
The command asks you for the file to save the key during the command. The default is fine. It also asks you for a passphrase. You can leave this blank for now.
This command creates an ed25519 SSH key with 100 rounds for increased resistance to brute-force cracking.
You have generated a public/private key pair. The public key is in the file ed25519.pub. For example:
ed25519 keys are very secure, but the public key is concise (1 line) compared to other key types. The one-line is easier to post and use.
It is safe and common to share the public key.
The private key is in the file ed25519. Do not share your private key
To verify if you have correctly added your key to GitHub, enter the following command:
The response should include the phrase "You've successfully authenticated, but GitHub does not provide shell access."
Now when you clone a repository, you can use the SSH version, e.g.,
If you have remote systems with accounts, you can ssh to them using your SSH key. E.g., for knuth2.cs.uakron.edu
use the command:
This will ask for your username/password login and install your public SSH key on your account at the server. From now on, it will not ask you for a username/password to log in from your local computer.
On Ubuntu, to get this command, you may have to install a package: