fangwenxue
V2EX  ›  问与答

github ssh 认证失败

  •  
  •   fangwenxue · Sep 30, 2022 · 2898 views
    This topic created in 1497 days ago, the information mentioned may be changed or developed.
    ➜  pyList git:(master) ✗ ssh -T [email protected] -v
    
    OpenSSH_8.6p1, LibreSSL 2.8.3
    debug1: Reading configuration data /Users/caoyufei/.ssh/config
    debug1: /Users/caoyufei/.ssh/config line 1: Applying options for *
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
    debug1: /etc/ssh/ssh_config line 54: Applying options for *
    debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
    debug1: Connecting to github.com port 22.
    debug1: Connection established.
    debug1: identity file /Users/caoyufei/.ssh/id_rsa type 0
    debug1: identity file /Users/caoyufei/.ssh/id_rsa-cert type -1
    debug1: identity file /Users/caoyufei/.ssh/id_dsa type -1
    debug1: identity file /Users/caoyufei/.ssh/id_dsa-cert type -1
    debug1: identity file /Users/caoyufei/.ssh/id_ecdsa type -1
    debug1: identity file /Users/caoyufei/.ssh/id_ecdsa-cert type -1
    debug1: identity file /Users/caoyufei/.ssh/id_ecdsa_sk type -1
    debug1: identity file /Users/caoyufei/.ssh/id_ecdsa_sk-cert type -1
    debug1: identity file /Users/caoyufei/.ssh/id_ed25519 type 3
    debug1: identity file /Users/caoyufei/.ssh/id_ed25519-cert type -1
    debug1: identity file /Users/caoyufei/.ssh/id_ed25519_sk type -1
    debug1: identity file /Users/caoyufei/.ssh/id_ed25519_sk-cert type -1
    debug1: identity file /Users/caoyufei/.ssh/id_xmss type -1
    debug1: identity file /Users/caoyufei/.ssh/id_xmss-cert type -1
    debug1: Local version string SSH-2.0-OpenSSH_8.6
    debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6
    debug1: compat_banner: match: OpenSSH_7.6 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
    debug1: Authenticating to github.com:22 as 'git'
    debug1: load_hostkeys: fopen /Users/caoyufei/.ssh/known_hosts2: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: algorithm: curve25519-sha256
    debug1: kex: host key algorithm: rsa-sha2-512
    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: SSH2_MSG_KEX_ECDH_REPLY received
    debug1: Server host key: ssh-rsa SHA256:rEmlJenVMSL5GVemSY0Gk8WGw6B4ege4J85M+vup8R0
    debug1: load_hostkeys: fopen /Users/caoyufei/.ssh/known_hosts2: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
    debug1: Host 'github.com' is known and matches the RSA host key.
    debug1: Found key in /Users/caoyufei/.ssh/known_hosts:2
    debug1: rekey out after 134217728 blocks
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: rekey in after 134217728 blocks
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_dsa
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_ecdsa
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_ecdsa_sk
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_ed25519 ED25519 SHA256:TKYtFMT/9O9RJ0IR1TvhrGE8KVYlOhNeQC2haFGT8Hs
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_ed25519_sk
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_xmss
    debug1: SSH2_MSG_EXT_INFO received
    debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss>
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Next authentication method: publickey
    debug1: Offering public key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Trying private key: /Users/caoyufei/.ssh/id_dsa
    debug1: Trying private key: /Users/caoyufei/.ssh/id_ecdsa
    debug1: Trying private key: /Users/caoyufei/.ssh/id_ecdsa_sk
    debug1: Offering public key: /Users/caoyufei/.ssh/id_ed25519 ED25519 SHA256:TKYtFMT/9O9RJ0IR1TvhrGE8KVYlOhNeQC2haFGT8Hs
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Trying private key: /Users/caoyufei/.ssh/id_ed25519_sk
    debug1: Trying private key: /Users/caoyufei/.ssh/id_xmss
    debug1: Next authentication method: keyboard-interactive
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Next authentication method: password
    [email protected]'s password:
    
    • mac 前 2 天还好好的,今天更新提示要密码了,求解,
    • id_rsa.pub 内容重复添加了几次还是一样
    14 replies  •  2022-10-01 10:02:55 +08:00
    ob
    ob
    Sep 30, 2022 via Android
    1
    config 文件有配置啥吗?
    fangwenxue
    fangwenxue
    OP
    Sep 30, 2022
    2
    @ob
    Host *
    ServerAliveInterval 60
    skybig
    skybig
    Sep 30, 2022
    3
    config 里指定下 IdentityFile 用哪个密钥
    fangwenxue
    fangwenxue
    OP
    Sep 30, 2022
    4
    @skybig 指定了一样
    ```
    debug1: Will attempt key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE explicit agent
    debug1: SSH2_MSG_EXT_INFO received
    debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss>
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Next authentication method: publickey
    debug1: Offering public key: /Users/caoyufei/.ssh/id_rsa RSA SHA256:ZVV506vMqSzb1yhJYrbHGrU3Wd+PvxnX/ABdAoewgSE explicit agent
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Next authentication method: keyboard-interactive
    debug1: Authentications that can continue: publickey,password,keyboard-interactive
    debug1: Next authentication method: password
    [email protected]'s password:
    ```
    skybig
    skybig
    Sep 30, 2022
    5
    @fangwenxue 那不知道了。要不你看看更新公告,是不是需要修改认证方式之类的。
    zk8802
    zk8802
    Sep 30, 2022 via iPhone
    6
    github.com 的 IP 对吗?
    november
    november
    Oct 1, 2022
    7
    ping 下 github ,大概率是运营商搞 dns 污染。
    ob
    ob
    Oct 1, 2022
    8
    ssh-add -k /Users/caoyufei/.ssh/id_rsa
    试下有没有用
    FanyFull
    FanyFull
    Oct 1, 2022 via Android
    9
    最近遇到了类似的问题,给 ssh 设置了代理之后解决了。
    fangwenxue
    fangwenxue
    OP
    Oct 1, 2022
    10
    @ob 也不行
    liuidetmks
    liuidetmks
    Oct 1, 2022
    11
    https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints


    我也遇到了你一样的问题 win10 ,也是这个公钥 rEmlJenVMSL5GVemSY0Gk8WGw6B4ege4J85M+vup8R0

    但是上面文档里面好像说官方只有 3 个公钥,不包含这个,不知道是不是文档没更新的原因
    fangwenxue
    fangwenxue
    OP
    Oct 1, 2022
    12
    @november 还真的是,换了 dns 就可以了
    ob
    ob
    Oct 1, 2022 via Android
    13
    @fangwenxue 如果你只有一个账号,直接把 config 移除,放到别的目录,试下默认的。
    fangwenxue
    fangwenxue
    OP
    Oct 1, 2022
    14
    @liuidetmks 解决了,dns 问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1655 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 23:57 · PVG 07:57 · LAX 15:57 · JFK 18:57
    ♥ Do have faith in what you're doing.