内网GitLab地址 UM账号密码登录
查看自己的 SSH 证书
$ cd ~/.ssh
$ ls
如果没有会报错找不着文件夹, 生成证书, 一直点 enter
就好, 不设置密码
$ ssh-keygen -t rsa -C "your_email@example.com"
完成之后~/.ssh
目录下会生成2个文件, id_rsa
和id_rsa.pub
, 代表公钥和私钥, 用cat
命令快速查看公钥, 复制
$ cat ~/.ssh/id_rsa.pub
在 GiLab 上设置 Profile Settings --> SSH Keys --> Add key
这样, GitLab 服务器和本机就可以通信了