【问题标题】:SSH connection with gitlab与 gitlab 的 SSH 连接
【发布时间】:2014-09-08 16:40:41
【问题描述】:

我无法通过 SSH 克隆托管在 gitlab 上的存储库(https 工作正常)。 公钥已通过 Web 界面提交给 gitlab,但服务器由于某种原因不接受提供的密钥,而是转而使用密码验证。奇怪的是 ssh auth 可以在其他服务器上运行,所以我假设我需要更改 ssh_config 中的某些内容以使其与 gitlab 一起使用。我将不胜感激有关此事的一些建议。

ssh -vT 日志打印以下内容:

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 domain [172.16.64.85] port 22.
debug1: Connection established.
debug1: could not open key file '/etc/ssh/ssh_host_key': No such file or directory
debug1: could not open key file '/etc/ssh/ssh_host_dsa_key': Permission denied
debug1: could not open key file '/etc/ssh/ssh_host_ecdsa_key': Permission denied
debug1: could not open key file '/etc/ssh/ssh_host_rsa_key': Permission denied
debug1: could not open key file '/etc/ssh/ssh_host_ed25519_key': Permission denied
debug1: could not open key file '/etc/ssh/ssh_host_dsa_key': Permission denied
debug1: could not open key file '/etc/ssh/ssh_host_ecdsa_key': Permission denied
debug1: could not open key file '/etc/ssh/ssh_host_rsa_key': Permission denied
debug1: could not open key file '/etc/ssh/ssh_host_ed25519_key': Permission denied
debug1: identity file /home/ja/.ssh/id_rsa type 1
debug1: identity file /home/ja/.ssh/id_rsa-cert type -1
debug1: identity file /home/ja/.ssh/id_dsa type -1
debug1: identity file /home/ja/.ssh/id_dsa-cert type -1
debug1: identity file /home/ja/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/ja/.ssh/id_ed25519 type -1
debug1: identity file /home/ja/.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
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH_5* compat 0x0c000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA b6:a4:91:33:80:c3:46:82:e2:4e:21:be:7e:a0:b0:c5
debug1: Host 'domain' is known and matches the ECDSA host key.
debug1: Found key in /home/ja/.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: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/ja/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/ja/.ssh/id_dsa
debug1: Trying private key: /home/ja/.ssh/id_ecdsa
debug1: Trying private key: /home/ja/.ssh/id_ed25519
debug1: Next authentication method: password
git@domains's password: 

【问题讨论】:

    标签: ssh gitlab


    【解决方案1】:

    确保您的公共 ssh 密钥已在您的 GitLab 帐户中正确注册(连续一行)。

    GitLab SSH troubleshooting page 提到例如,如果在设置 GitLab 之前公钥已经在 ~/.ssh/authorized_keys 中,或者如果 authorized_keys 文件不同步,它将不起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-01
      • 2020-05-12
      • 2018-02-07
      • 2021-08-28
      • 1970-01-01
      • 2021-04-07
      • 2017-01-17
      • 2011-03-05
      相关资源
      最近更新 更多