How Git generates SSH keys

Prerequisites:

Git has been successfully installed, if not installed, please see: https://blog.csdn.net/weixin_43184774/article/details/103798736

 

Steps:

1. On the computer desktop, right-click and select "Git Bash Here" to open the Git command window

2. Configure the user in the Git command window and enter the following command:

git config --global user.name "blkj"

Among them: "blkj" is the user name you want to fill in

3. Continue to configure the mailbox in the Git window and enter the following command:

git config --global user.email "[email protected]"

Where: "[email protected]" is your own email address

4. At this time, a .gitconfig configuration file will be generated in the C:\Users\Administrator directory (this file cannot be deleted)

5. View the contents of the .gitconfig configuration file

6. Continue to enter the following commands in the Git command window to generate SSH public and private keys

ssh-keygen -t rsa -C "[email protected]" 

7. Enter the C:\Users\Administrator\.ssh directory and view the generated SSH key

8. Enter the following command in the Git window to view the public key and private key

cat ~/.ssh/id_rsa.pub

Guess you like

Origin blog.csdn.net/weixin_43184774/article/details/106566715