The computer installed a virtual machine, want to establish a secure SSH connection with Gitlab, the steps are as follows
1. Native SSH key generation
System Environment: Linux
Log in with the root user, execute the command: ssh-keygen-t rsa-c "[email protected]", the default carriage return is OK, the command will create a hidden. SSH folder with 2 files in the folder: Id_rsa (private key) and id_ Rsa.pub (public key), use command: VI id_rsa.pub to view public key contents, copy public key contents.
2.gitLab Add SSH Key
3. Authorization
chmod ~/.ssh/id_rsa (only master has read and write access)
chmod ~/.ssh (only master has read, write, execute permission)
4. Problems and Solutions encountered:
Problem: Add SSH key times error in Gitlab:
Key is invalid
Fingerprint cannot be generated
Solution: This problem occurs because some content is automatically wrapped, resulting in the inability to pass the check, delete word wrap, delete the word wrap after the key such as:
Add success:
Gitlab Add SSH Key