gitlab ssh配置

2020-05-30  本文已影响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]

上一篇 下一篇

猜你喜欢

热点阅读