What is ssh?
SSH keys are used to establish a secure connection between your computer and GitLab.
terminal manipulation copy/spawn ssh
1. Enter the ssh directory
cd ~/.ssh
2. Check whether there is a public key
ls
.pub
If it exists, there will be a file with the suffix in the directory . If it does not exist
, generate the public key 3 by yourself to generate the public key
ssh-keygen -t rsa -C "你的邮箱"
During the process of generating the public key, you can always press the Enter key
4 to view the public key
cat id_rsa.pub # 如果是在.ssh文件夹下面
cat /Users/电脑用户名/.ssh/id_rsa.pub # 在其他目录下面查找ssh公钥
5. Associate the generated ssh with the gitlab project
Find the ssh key in your own gitlab
Paste your SSH public key, usually included in the file ~/.ssh/id_ed25519.pub'
or ~/.ssh/id_rsa.pub
and start with ssh-ed25519
or ssh-rsa
.