当前位置:   article > 正文

git@gitlab.mx.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)解决方案_git permission denied (publickey,gssapi-keyex,gssa

git permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

mac OS升级后,Jenkins打包莫名一直获取git报错。

执行命令查询详情信息:ssh -vvv git@gitlab.mx.com

  1. debug1: Authentications that can continue: publickey,gssapi-with-mic,password
  2. Permission denied, please try again.
  3. git@git.bdaa.pro's password:
  4. debug3: send packet: type 50
  5. debug2: we sent a password packet, wait for reply
  6. debug3: receive packet: type 51
  7. debug1: Authentications that can continue: publickey,gssapi-with-mic,password
  8. debug2: we did not send a packet, disable method
  9. debug1: No more authentication methods to try.
  10. git@git.bdaa.pro: Permission denied (publickey,gssapi-with-mic,password).

解决办法:

在 git 安装目录下,找到 ssh_config 文件( /private/etc/ssh/ssh_config),做出如下设置:

  1. # Host *
  2. # ForwardAgent no
  3. # ForwardX11 no
  4. # PasswordAuthentication yes
  5. # HostbasedAuthentication no
  6. # GSSAPIAuthentication no
  7. # GSSAPIDelegateCredentials no
  8. # BatchMode no
  9. # CheckHostIP yes
  10. # AddressFamily any
  11. # ConnectTimeout 0
  12. # StrictHostKeyChecking ask
  13. IdentityFile ~/.ssh/id_rsa
  14. IdentityFile ~/.ssh/id_dsa
  15. IdentityFile ~/.ssh/id_ecdsa
  16. IdentityFile ~/.ssh/id_ed25519
  17. HostkeyAlgorithms +ssh-rsa # 使 openssh 支持 rsa 算法
  18. PubkeyAcceptedAlgorithms +ssh-rsa
  19. PubkeyAcceptedKeyTypes +ssh-rsa

重新用 ssh 连接远程库,连接成功。

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号