【问题标题】:SSH Key prompts password for "ssh -Tv git@gitlab.tubit.tu-berlin.de"SSH Key 提示密码“ssh -Tv git@gitlab.tubit.tu-berlin.de”
【发布时间】:2020-12-23 04:04:59
【问题描述】:

我正在尝试使用 ED25519 通过 SSH 连接到 GitLab,并遵循以下来源:https://docs.gitlab.com/ee/ssh/。当我测试连接并期待欢迎消息时,它不起作用并且仍然提示输入密码。我尝试了我的用户密码,但它不起作用,我不确定此时需要哪个密码。这是输出。

ssh -Tv git@gitlab.tubit.tu-berlin.de

OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f  31 Mar 2020
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
    debug1: /etc/ssh/ssh_config line 21: Applying options for *
    debug1: Connecting to gitlab.tubit.tu-berlin.de [130.149.7.193] port 22.
    debug1: Connection established.
    debug1: identity file /home/christian/.ssh/id_rsa type -1
    debug1: identity file /home/christian/.ssh/id_rsa-cert type -1
    debug1: identity file /home/christian/.ssh/id_dsa type -1
    debug1: identity file /home/christian/.ssh/id_dsa-cert type -1
    debug1: identity file /home/christian/.ssh/id_ecdsa type -1
    debug1: identity file /home/christian/.ssh/id_ecdsa-cert type -1
    debug1: identity file /home/christian/.ssh/id_ecdsa_sk type -1
    debug1: identity file /home/christian/.ssh/id_ecdsa_sk-cert type -1
    debug1: identity file /home/christian/.ssh/id_ed25519 type 3
    debug1: identity file /home/christian/.ssh/id_ed25519-cert type -1
    debug1: identity file /home/christian/.ssh/id_ed25519_sk type -1
    debug1: identity file /home/christian/.ssh/id_ed25519_sk-cert type -1
    debug1: identity file /home/christian/.ssh/id_xmss type -1
    debug1: identity file /home/christian/.ssh/id_xmss-cert type -1
    debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1
    debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
    debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000002
    debug1: Authenticating to gitlab.tubit.tu-berlin.de:22 as 'git'
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
    debug1: kex: host key algorithm: ssh-rsa
    debug1: kex: server->client cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
    debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<3072<8192) sent
    debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
    debug1: Server host key: ssh-rsa SHA256:aA86J3auCo20sHneGIvwxk/uay4ynBNkWIgiio/qUUw
    debug1: Host 'gitlab.tubit.tu-berlin.de' is known and matches the RSA host key.
    debug1: Found key in /home/christian/.ssh/known_hosts:3
    debug1: rekey out after 4294967296 blocks
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: rekey in after 4294967296 blocks
    debug1: Will attempt key: /home/christian/.ssh/id_ed25519 ED25519 SHA256:rFB2QOkPTiiqlMAN1V9RS9QVV2vrgxgRAa9wXm0RdJI agent
    debug1: Will attempt key: /home/christian/.ssh/id_rsa 
    debug1: Will attempt key: /home/christian/.ssh/id_dsa 
    debug1: Will attempt key: /home/christian/.ssh/id_ecdsa 
    debug1: Will attempt key: /home/christian/.ssh/id_ecdsa_sk 
    debug1: Will attempt key: /home/christian/.ssh/id_ed25519_sk 
    debug1: Will attempt key: /home/christian/.ssh/id_xmss 
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,keyboard-interactive
    debug1: Next authentication method: publickey
    debug1: Offering public key: /home/christian/.ssh/id_ed25519 ED25519 SHA256:rFB2QOkPTiiqlMAN1V9RS9QVV2vrgxgRAa9wXm0RdJI agent
    debug1: Authentications that can continue: publickey,keyboard-interactive
    debug1: Trying private key: /home/christian/.ssh/id_rsa
    debug1: Trying private key: /home/christian/.ssh/id_dsa
    debug1: Trying private key: /home/christian/.ssh/id_ecdsa
    debug1: Trying private key: /home/christian/.ssh/id_ecdsa_sk
    debug1: Trying private key: /home/christian/.ssh/id_ed25519_sk
    debug1: Trying private key: /home/christian/.ssh/id_xmss
    debug1: Next authentication method: keyboard-interactive
    Password: 
    debug1: Authentications that can continue: publickey,keyboard-interactive
    Password: 
    debug1: Authentications that can continue: publickey,keyboard-interactive
    Password: 
    debug1: Authentications that can continue: publickey,keyboard-interactive
    debug1: No more authentication methods to try.
    git@gitlab.tubit.tu-berlin.de: Permission denied (publickey,keyboard-interactive).

【问题讨论】:

    标签: ssh gitlab


    【解决方案1】:

    根据您提到的指南,您需要仔细检查:

    • 您使用的是 OpenSSH 6.5 或更高版本
    • 您已将公钥复制到您的 GitLab 用户帐户设置/SSH 密钥

    我会先用不带任何密码的 SSH 私钥对其进行测试。

    【讨论】:

      猜你喜欢
      • 2021-03-29
      • 2015-10-01
      • 1970-01-01
      • 2020-04-03
      • 1970-01-01
      • 2013-03-17
      • 2016-04-08
      • 1970-01-01
      • 2015-08-10
      相关资源
      最近更新 更多