gitlab 添加 ssh_key
1, 本地 git 配置username 和 email
# git config --global user.name 'gao'
# git config --global user.email 'gaoxianlei@xin.com'
2,生成 ssh_key
# ssh-keygen -t rsa -C "gaoxianlei@xin.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gao/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gao/.ssh/id_rsa.
Your public key has been saved in /home/gao/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256: *****
The key's randomart image is:
****
3,添加到 gitlab
https://***.com/dashboard/projects
->Profill Setting
->SSH Keys -> +Add SSH Keys
将 .ssh/id_rsa.pub 内容粘贴到 input 表单。
所有评论(0)