After Mac is upgraded to MacOS Ventura 13.0, Gitlab authentication fails and a password is required for submission.

After pulling the code and submitting, I found that I could not submit the commit to gitlab, and it prompted that a password was required. After I found that the key and the public key on gitlab were both correct, I tried to print the SSH connection log between the local and gitlab server. The log is as follows:

xxx@MacBook-Pro GlobalPassenger % ssh -Tv [email protected]                                                                                       
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: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] 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 [email protected]
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 [email protected] 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

The key matching log prompts no mutual signature algorithm. To enable display configuration, add the following configuration in the ~/.ssh/config file (create one if it does not exist):

PubkeyAcceptedKeyTypes +ssh-rsa

After modifying the configuration, save it and retest, and the authentication will be successful.

Guess you like

Origin blog.csdn.net/qq_34681580/article/details/127656342