gitlab公共密钥拒绝git clone请求

时间:2019-02-20 16:53:57

标签: git ssh gitlab

我知道可能已经有人问过这个问题,但是找不到解决我的问题的方法。问题是,当我尝试通过ssh克隆存储库时,它只是拒绝了我的公钥。


 dorin@dorin-All-Series  ~  git clone git@gitlab.rankingcoach.com:d.jivoin/redis_ansible.git
Cloning into 'redis_ansible'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The result is the same if I use my username:

 ✘ dorin@dorin-All-Series  ~  ssh -vT git@gitlab.rankingcoach.com    
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to gitlab.rankingcoach.com [176.9.54.190] port 22.
debug1: Connection established.
debug1: identity file /home/dorin/.ssh/id_rsa type 1
debug1: identity file /home/dorin/.ssh/id_rsa-cert type -1
debug1: identity file /home/dorin/.ssh/id_dsa type -1
debug1: identity file /home/dorin/.ssh/id_dsa-cert type -1
debug1: identity file /home/dorin/.ssh/id_ecdsa type -1
debug1: identity file /home/dorin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/dorin/.ssh/id_ed25519 type -1
debug1: identity file /home/dorin/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.12
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.7
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.7 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-sha1-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA b1:2b:32:4a:56:09:26:98:50:06:74:b8:77:eb:6b:81
debug1: Host 'gitlab.rankingcoach.com' is known and matches the ECDSA host key.
debug1: Found key in /home/dorin/.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/dorin/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/dorin/.ssh/id_dsa
debug1: Trying private key: /home/dorin/.ssh/id_ecdsa
debug1: Trying private key: /home/dorin/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

我什至尝试重建授权密钥,但结果是相同的...

1 个答案:

答案 0 :(得分:0)

您的Git URL必须已更改。
使用以下命令更改本地目录中的URL:

git remote set-url origin git@gitlab.rankingcoach.com:d.jivoin/redis_ansible.git

希望这能回答您的问题!