美文网首页
gitlab ssh配置

gitlab ssh配置

作者: 西亭月圆 | 来源:发表于2020-05-30 16:31 被阅读0次

1、ssh-keygen -t rsa -C "your.email@example.com" -b 4096   # 建议在~/.ssh/目录下生成,使用自定义名称

2、pbcopy < ~/.ssh/xxx.pub   # 以MacOS为例,复制公钥至粘贴板

3、粘贴公钥至gitlab个人配置的ssh秘钥中

4、本地存在多个秘钥对时在 ~/.ssh/目录下,创建config文件:

#  config文件

# gitlab

Host xxx.xxx.xxx.xxx

Port xxx

RSAAuthentication yes   # 若是报错Unsupported option "rsaauthentication"则注释该行

IdentityFile ~/.ssh/xxx   # xxx为私钥,也可写公钥

5、测试

ssh -T git@host -p [port]

相关文章

网友评论

      本文标题:gitlab ssh配置

      本文链接:https://www.haomeiwen.com/subject/teafzhtx.html