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

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

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

解决办法:

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

# Host *
#   ForwardAgent no
#   ForwardX11 no
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_dsa
IdentityFile ~/.ssh/id_ecdsa
IdentityFile ~/.ssh/id_ed25519
HostkeyAlgorithms +ssh-rsa  # 使 openssh 支持 rsa 算法
PubkeyAcceptedAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

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

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐