How to generate SSH key

SSH key
provides a way to communicate with GitHub. In this way, you can use GitHub as your own remote server for version control without entering a password.
General process:

  1. Check if SSH keys exist
  2. Generate new ssh key
  3. Add ssh key to GitHub

1. Check whether SSH keys exist or not.
Enter the command:

ls -al ~/.ssh

If there is a file id_rsa.pub or id_dsa.pub, add the SSH key directly to GitHub, otherwise you need to generate an SSH key

2. Directly add the SSH key to GitHub
Use the command:

cat id_rsa.pub

The displayed information is the SSH key. Just copy the information to the Add SSH key page of GitHub.
3. You need to generate an SSH key
and enter ssh-keygen -t rsa -C in the command line. "[email protected]"
will be in by default Two files id_rsa and id_rsa.pub are generated under the corresponding path (/your_home_path)
. After they are generated, the second step can be performed

Guess you like

Origin blog.csdn.net/weixin_42271802/article/details/112173520