zishu's blog

zishu's blog

一个热爱生活的博主。https://zishu.me

Generate a new SSH key in GitHub

To generate a new SSH key on GitHub, follow these steps:

  1. Open the terminal or command prompt.
  2. Enter the following command, replacing "[email protected]" with your registered email address on GitHub.
ssh-keygen -t rsa -b 4096 -C "[email protected]"
  1. Later, you will be prompted to enter the file save location and passphrase. You can keep all the default settings and simply press Enter.
  2. Then enter the following command: eval "$(ssh-agent -s)"
  3. Next, enter the following command to add the new key to the ssh-agent: ssh-add ~/.ssh/id_rsa
  4. Finally, add your public key to GitHub. Go to GitHub settings and click on "SSH and GPG keys".
  5. Click on the "New key" button.
  6. Enter a descriptive title in the "Title" field so that you can identify this key.
  7. In the "Key" field, copy and paste the contents of the "~/.ssh/id_rsa.pub" file.
  8. Click the "Add SSH key" button to save your new key.

Now, you have successfully generated a new SSH key for GitHub!

Tutorial from chatGPT, just documenting it.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.