Mac升级到 MacOS Ventura 13.0 后Gitlab认证失败,提交提示需要密码

1 篇文章 0 订阅

拉代码和提交发现无法提交commit到gitlab上,提示需要密码,在发现密钥与gitlab上公钥都正确的情况下,尝试打印本地与gitlab服务器的ssh连接日志,日志如下:

xxx@MacBook-Pro GlobalPassenger % ssh -Tv git@git.xiaojukeji.com                                                                                       
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/didi/.ssh/config
debug1: /Users/didi/.ssh/config line 9: Applying options for git.xiaojukeji.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to git.xiaojukeji.com port 22.
debug1: Connection established.
debug1: identity file /Users/didi/.ssh/id_rsa_gitlab type 0
debug1: identity file /Users/didi/.ssh/id_rsa_gitlab-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6
debug1: compat_banner: match: OpenSSH_6.6 pat OpenSSH_6.5*,OpenSSH_6.6* compat 0x14000002
debug1: Authenticating to git.xiaojukeji.com:22 as 'git'
debug1: load_hostkeys: fopen /Users/didi/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:Cb/K/240INDJLv7WN7retR7kR2fFyEfQatG8hQUVrf8
debug1: load_hostkeys: fopen /Users/didi/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'git.xiaojukeji.com' is known and matches the ECDSA host key.
debug1: Found key in /Users/didi/.ssh/known_hosts:2
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities
debug1: Will attempt key: /Users/didi/.ssh/id_rsa_gitlab RSA SHA256:1ghypYZ9m8oO3Rt9L8dYLcz1JhyhU41lB1PinCOZl7I explicit
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/didi/.ssh/id_rsa_gitlab RSA SHA256:1ghypYZ9m8oO3Rt9L8dYLcz1JhyhU41lB1PinCOZl7I explicit
debug1: Server accepts key: /Users/didi/.ssh/id_rsa_gitlab RSA SHA256:1ghypYZ9m8oO3Rt9L8dYLcz1JhyhU41lB1PinCOZl7I explicit
Authenticated to git.xiaojukeji.com ([10.88.151.33]:22) using "publickey".
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Sending environment.
debug1: channel 0: setting env LC_CTYPE = "zh_CN.UTF-8"
Welcome to GitLab, @ruanyandong!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3080, received 3136 bytes, in 0.4 seconds
Bytes per second: sent 6978.2, received 7105.0
debug1: Exit status 0

密钥匹配的日志提示no mutual signature algorithm。需要显示配置启用,在~/.ssh/config文件中(如果不存在就创建一个)添加以下配置:

PubkeyAcceptedKeyTypes +ssh-rsa

修改配置后保存重新测试,就可以认证成功。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值