前提
使用 ssh-keygen -t ed25519 -C "<comment>" 命令生成密钥对,并将 /home/.ssh/id_ed25519.pub 内容添加到 gitlab 的用户 ssh 设置中
zshrc 中配置了 ssh-agent plugin
---
clone 仓库时提示
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
---
执行 ssh -Tvvv
[email protected] 提示
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/minchen/.ssh/id_ed25519 ED25519 SHA256:gvJaTnUsmo4yy2inbG5urOrZfr8wewE/qA3qm3A+OIQ agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Offering public key:
[email protected] RSA SHA256:O14ly7v/7CyshiZcSla3Zd0v8Mg78jKpfGLK3btaRr8 agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/minchen/.ssh/id_rsa
debug3: no such identity: /Users/minchen/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /Users/minchen/.ssh/id_dsa
debug3: no such identity: /Users/minchen/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /Users/minchen/.ssh/id_ecdsa
debug3: no such identity: /Users/minchen/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /Users/minchen/.ssh/id_ecdsa_sk
debug3: no such identity: /Users/minchen/.ssh/id_ecdsa_sk: No such file or directory
debug1: Trying private key: /Users/minchen/.ssh/id_ed25519_sk
debug3: no such identity: /Users/minchen/.ssh/id_ed25519_sk: No such file or directory
debug1: Trying private key: /Users/minchen/.ssh/id_xmss
debug3: no such identity: /Users/minchen/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).
(开始生成了一个 rsa 密钥对,相同错误,后来把.ssh 目录清空后重新生成的 ed25519 密钥对,gitlab 上也同步重置)