V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
fangwenxue
V2EX  ›  问与答

github ssh 认证失败

  •  
  •   fangwenxue · 2022-09-30 19:28:09 +08:00 · 1691 次点击
    这是一个创建于 788 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ➜  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 条回复    2022-10-01 10:02:55 +08:00
    ob
        1
    ob  
       2022-09-30 19:50:14 +08:00 via Android
    config 文件有配置啥吗?
    fangwenxue
        2
    fangwenxue  
    OP
       2022-09-30 20:07:56 +08:00
    @ob
    Host *
    ServerAliveInterval 60
    skybig
        3
    skybig  
       2022-09-30 21:37:42 +08:00
    config 里指定下 IdentityFile 用哪个密钥
    fangwenxue
        4
    fangwenxue  
    OP
       2022-09-30 21:42:39 +08:00
    @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
        5
    skybig  
       2022-09-30 22:21:29 +08:00
    @fangwenxue 那不知道了。要不你看看更新公告,是不是需要修改认证方式之类的。
    zk8802
        6
    zk8802  
       2022-09-30 23:23:32 +08:00 via iPhone
    github.com 的 IP 对吗?
    november
        7
    november  
       2022-10-01 00:25:01 +08:00
    ping 下 github ,大概率是运营商搞 dns 污染。
    ob
        8
    ob  
       2022-10-01 00:34:12 +08:00
    ssh-add -k /Users/caoyufei/.ssh/id_rsa
    试下有没有用
    FanyFull
        9
    FanyFull  
       2022-10-01 00:40:18 +08:00 via Android
    最近遇到了类似的问题,给 ssh 设置了代理之后解决了。
    fangwenxue
        10
    fangwenxue  
    OP
       2022-10-01 09:58:45 +08:00
    @ob 也不行
    liuidetmks
        11
    liuidetmks  
       2022-10-01 10:02:24 +08:00
    https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints


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

    但是上面文档里面好像说官方只有 3 个公钥,不包含这个,不知道是不是文档没更新的原因
    fangwenxue
        12
    fangwenxue  
    OP
       2022-10-01 10:02:31 +08:00
    @november 还真的是,换了 dns 就可以了
    ob
        13
    ob  
       2022-10-01 10:02:50 +08:00 via Android
    @fangwenxue 如果你只有一个账号,直接把 config 移除,放到别的目录,试下默认的。
    fangwenxue
        14
    fangwenxue  
    OP
       2022-10-01 10:02:55 +08:00
    @liuidetmks 解决了,dns 问题
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4532 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 10:11 · PVG 18:11 · LAX 02:11 · JFK 05:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.