不是重复的帖子(我搜索了主题,没有解决密码问题)
这是一个工作设置,SSH证书工作正常。没有在几个月内使用,没有得到ssh无法验证和服务器一直要求git密码...我已经尝试了GitLab中的每个PW集和我的mac上的admin pw,没有任何作用。我在MacBook上发布了以下新证书:
ssh-keygen -o -f ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub
我按照预期第一次得到以下内容(我已经清除了〜/ .ssh`中的known_hosts
文件):
The authenticity of host 'example.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'example.com' (ECDSA) to the list of known hosts.
当我使用ssh -vT [email protected]
测试ssh连接时,我得到以下结果:
MacBook:exampleCom example$ ssh -v [email protected]
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to example.com port 22.
debug1: Connection established.
debug1: identity file /Users/example/.ssh/id_rsa type 0
debug1: identity file /Users/example/.ssh/id_rsa-cert type -1
debug1: identity file /Users/example/.ssh/id_dsa type -1
debug1: identity file /Users/example/.ssh/id_dsa-cert type -1
debug1: identity file /Users/example/.ssh/id_ecdsa type -1
debug1: identity file /Users/example/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/example/.ssh/id_ed25519 type -1
debug1: identity file /Users/example/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/example/.ssh/id_xmss type -1
debug1: identity file /Users/example/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u7
debug1: match: OpenSSH_6.7p1 Debian-5+deb8u7 pat OpenSSH* compat 0x04000000
debug1: Authenticating to example.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
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: Server host key: ecdsa-sha2-nistp256 SHA256:J7RwXfLgnsuMlJNo4M0LotFN+XAi6q7ak2tlzJ6ECTI
debug1: Host 'example.com' is known and matches the ECDSA host key.
debug1: Found key in /Users/example/.ssh/known_hosts:2
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /Users/example/.ssh/id_rsa RSA SHA256:ItsLqWD1sVwEdkp3xIffO0PcAGZx2NdqhIuScZrzjqw agent
debug1: Will attempt key: /Users/example/.ssh/id_rsa RSA SHA256:lShiocfZXbNH9Cp3+w+aY6XDcSVDDTyBHC52L5Qc3N0
debug1: Will attempt key: /Users/example/.ssh/id_dsa
debug1: Will attempt key: /Users/example/.ssh/id_ecdsa
debug1: Will attempt key: /Users/example/.ssh/id_ed25519
debug1: Will attempt key: /Users/example/.ssh/id_xmss
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/example/.ssh/id_rsa RSA SHA256:ItsLqWD1sVwEdkp3xIffO0PcAGZx2NdqhIuScZrzjqw agent
debug1: Authentications that can continue: publickey,password
debug1: Offering public key: /Users/example/.ssh/id_rsa RSA SHA256:lShiocfZXbNH9Cp3+w+aY6XDcSVDDTyBHC52L5Qc3N0
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/example/.ssh/id_dsa
debug1: Trying private key: /Users/example/.ssh/id_ecdsa
debug1: Trying private key: /Users/example/.ssh/id_ed25519
debug1: Trying private key: /Users/example/.ssh/id_xmss
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,password).
Have also tried https access and the following error:
MacBook:MyGitRepo jeffb$ git push origin_https https://example.com:4438/root/MyGitRepo.git
error: src refspec https://example.com does not match any.
error: failed to push some refs to 'https://example.com:4438/root/MyGitRepo.git'
问题是客户端上的密钥损坏 - 在Gitlab服务器上创建了新密钥/证书并替换了公钥。