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 表单。

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐