gitLab 的ssh的配置
2019-06-21 本文已影响0人
best_su
ssh的配置
1.打开本地git bash,使用如下命令生成ssh公钥和私钥对
ssh-keygen -t rsa -C 'xxx@xxx.com' 然后一路回车(-C 参数是你的邮箱地址)
2.然后会出现:Enter file in which to save the key (/Users/yzq/.ssh/id_rsa):
继续回车
3.如果你的.ssh/id_rsa已经,则会出现:/Users/yzq/.ssh/id_rsa already exists.
Overwrite (y/n)? y
输入:y (重新覆盖)
输入:n (不覆盖
4.设置你的密码
5.现在只需要查看本机ssh公钥,获取得到它
cd ~/.ssh
open .
打开 id_rsa.pub文件,全部复制
6.打开gitlab,找到Profile Settings-->SSH Keys--->Add SSH Key,并把上一步中复制的内容粘贴到Key所对应的文本框