ubuntu 16.04 how to generate SSH key and how to view SSH key
check if SSH Key exists locally
enter
at the terminal
ls -al ~/.ssh
if output is:
No such file or directory
then there is no SSH key
, if you have it, it looks like this:
generates a new SSH key
first enter
in the terminal
ssh-keygen -t rsa -C "[email protected]"
[email protected] for your email address when registering on GitHub or GitLab
enter the terminal will display:
Created directory '/Users/xxx/.ssh'.
Enter passphrase (empty for no passphrase):
The path to save.ssh/ id_RSA is /Users/ XXX /.ssh/ id_RSA, press enter directly.
one thing to note here is that if you already have an SSH key and you want to recreate it using the above it will tell you that you don’t want to regenerate, just type y and press enter.
and the terminal will prompt:
Created directory '/Users/xxx/.ssh'.
Enter passphrase (empty for no passphrase):
You are prompted to set passphrase. You are required to enter passphrase every time you communicate with Git to avoid problems caused by some wrong operation. It is recommended to set it.
after success, the terminal will prompt:
Your identification has been saved in /Users/xxx/.ssh/id_rsa.
Your public key has been saved in /Users/xxx/.ssh/id_rsa.pub.
The key fingerprint is:
16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 [email protected]
The key's randomart image is:
心形图形
Then input at the terminal:
ssh-add ~/.ssh/id_rsa
You will be asked to enter the Passphrase entered in the above step
after success, the terminal display:
Identity added: /Users/xxx/.ssh/id_rsa (/Users/xxx/.ssh/id_rsa)
Finally, two files are generated in /Users/ XXX /.ssh/, id_RSA and id_Rsa.pub
input at the terminal:
cat /Users/xxx/.ssh/id_rsa.pub
terminal will display your SSH key, just copy it directly.
that’s all ~ ~ O (∩ _ ∩) O ha ha ~
Read More:
- How to generate UML Diagrams from Java code in Eclipse
- How to Disable Protected View in Microsoft Excel
- How to generate main () method in java graphical interface
- Mobaxterm connects to Ubuntu server through SSH network error: software caused connection abort
- express nodejs Failed to lookup view error in views directory (How to Fix)
- Windows subsystem Ubuntu 18.04 solves SSH problem
- How to get all the keys of map by golang
- ansible Q&A: Failed to connect to the host via ssh: ssh_exchange_identification and Authentication or per
- How to install postman tool in Ubuntu 16.04
- How to install cuda10.01in Ubuntu18.04
- Ubuntu starts or restarts SSH service
- How to generate PDF by C #
- Ubuntu 20.04: How to create shortcut startup mode in IntelliJ idea
- How to configure OpenGL with CodeBlocks in Ubuntu
- How to install scikit learn and other scientific computing libraries in Ubuntu 16.04
- How to manually upgrade Ubuntu 16.04 LTS to Ubuntu 18.04 LTS, Part I
- How to search files or folders in Ubuntu
- Ubuntu network configuration+Fixing “Failed to bring up eth0” in Ubuntu
- How to Fix ubuntu phpmyadmin error: “Connection for controluser as defined in your configuration failed”
- How to view the version of MySQL database