美文网首页
git ssh 多主机配置配置

git ssh 多主机配置配置

作者: 7cf6c01a5633 | 来源:发表于2019-01-15 13:00 被阅读0次

ssh配置

#vi ~/.ssh/config
Host domain/ip
#   ForwardAgent no
#   ForwardX11 no
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/gitlab_ecdsa
#   Port 22
#   Protocol 2

#一般这样配置就可以了
Host domain/ip
    IdentityFile ~/.ssh/gitlab_ecdsa

#可以配置多个域名
Host gitlab.com
    IdentityFile ~/.ssh/gitlab_ecdsa

Host github.com
    IdentityFile ~/.ssh/github_ecdsa

#测试是否生效
$ ssh -T git@gitlab.com
Welcome to GitLab, haha!

相关文章

网友评论

      本文标题:git ssh 多主机配置配置

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