View the local ssh public key and generate a public key

View ssh public key method:
1. Via the command window
a. Open your git bash window
b. Go to the .ssh directory: cd ~ / .ssh
c. Find the id_rsa.pub file: ls

d. View the public key: cat id_rsa.pub or vim id_rsa.pub
As shown in the figure:

2. Or you can directly enter the command: cat ~ / .ssh / id_rsa.pub

3. Or you can directly open the .ssh folder under your user (usually Administrator) and open the id_rsa.pub file in it, as shown in the figure:

What is a public key

1. Many servers require authentication, and ssh authentication is one of them. Generate the public key on the client and add the generated public key to the server. You do not need to enter the user name and password each time you connect to the server.
2. Many git servers use ssh authentication. You need to send the public key you generated to the code warehouse administrator, and let him add it to the server, and you can freely pull and submit code through ssh.

Generate public key
1. If you cannot find the public key through the above method, you need to generate the public key first: ssh-keygen
2. Next, the address where the public key is stored will be confirmed. The default is the path mentioned above. Enter directly to confirm
3. Next, you will be asked to enter the password and confirm the password. If you don't want to set the password, just don't enter the content. Press enter
As shown in the figure:

Author: