View and generate SSH Key for Mac systems

First, open vim (terminal.app) to see if there is a local SSH-Key

 

  # ls -al ~/.ssh

 

>> If vim output is the following: there is no proof of local generation of SSH Key, do the second step.

 

  # No such file or directory

 

>> If vim output is the following: proof of local SSH Key file already exists, do the fourth step.

 

  # id_rsa        id_rsa.pub

 

Second, if not, to generate a new SSH Key

 

  #ssh-keygen -t rsa -C"you_email"

 

your_email: Here fill in the mailbox when you register GitLab or GitHub.

 

The latter suggesting a direct hit Enter, all the way to completion.

 

Third, generate and add SSH Key

 

  # ssh-add ~/.ssh/id_rsa

 

Fourth, view the SSH Key

 

  # cat /Users/xxx/.ssh/id_rsa.pub

 

xxx is your computer user name, for example: howieMacBook-Pro: howie keyword ~ ​​howie $ in.

 

Good SSH Key generated by copying or GitHub GitLab added to the SSH Key can be.

 

Guess you like

Origin www.cnblogs.com/guopengju/p/11349579.html