Here are the steps to generate and add an Ed25519 key pair on Linux and add it to your GitHub account:
- Open your terminal on Linux.
- Type the following command to generate a new Ed25519 key:
- ssh-keygen -t ed25519 -C "your_email@example.com"
- This will create a new SSH key pair with the Ed25519 algorithm. You can replace the email address with your own email.
- You will be prompted to enter a file path and name to save the key pair. You can leave it blank to save it in the default directory (~/.ssh).
- You will be prompted to enter a passphrase. It is recommended to use a strong passphrase to protect your key.
- Once the key pair is generated, use the following command to add the SSH key to your SSH agent:
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_ed25519
- To add the SSH key to your GitHub account, log in to your GitHub account and go to your account settings.
- Click on "SSH and GPG keys" and then click on "New SSH key".
- In the "Title" field, enter a descriptive name for the key.
- In the "Key" field, copy the contents of the public key file that was generated earlier. You can do this by opening the file with a text editor and copying the entire contents. The file will be named id_ed25519.pub and located in the .ssh directory in your home folder.
- Click on "Add SSH key" to add the key to your GitHub account.
- To verify that the key has been added successfully, use the following command in your terminal:
- ssh -T git@github.com
- You should see a message that says "Hi username! You've successfully authenticated, but GitHub does not provide shell access."
Comments