Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ssh身份验证成功访问git(github.com),但连接关闭_Git_Ssh - Fatal编程技术网

ssh身份验证成功访问git(github.com),但连接关闭

ssh身份验证成功访问git(github.com),但连接关闭,git,ssh,Git,Ssh,这曾经奏效,但现在不行了。不知道发生了什么变化。。。 我想在github.com上通过SSH使用git。 我的SSH密钥上传到github.com 为了解开谜团,我决定重新生成另一个SSH密钥~/.SSH/id\u rsa\u me,并将其上传到github.com。 My~/.ssh/config告诉ssh将此标识文件用于github.com ServerAliveInterval 30 Host github.com HostName github.com User git Iden

这曾经奏效,但现在不行了。不知道发生了什么变化。。。 我想在github.com上通过SSH使用git。 我的SSH密钥上传到github.com

为了解开谜团,我决定重新生成另一个SSH密钥
~/.SSH/id\u rsa\u me
,并将其上传到github.com。 My
~/.ssh/config
告诉ssh将此标识文件用于github.com

ServerAliveInterval 30

Host github.com
 HostName github.com
 User git
 IdentityFile ~/.ssh/id_rsa_me
 LogLevel DEBUG3
~/.ssh/id\u rsa\u me
config
的访问权限为600

例如,当我尝试在我的存储库上执行git push origin master时,我在调试消息中看到:

debug1: identity file /home/axelle/.ssh/id_rsa_me type 1
将拾取良好标识文件。好

Warning: the RSA host key for 'github.com' differs from the key for the IP address '192.30.253.112'
Offending key for IP in /home/axelle/.ssh/known_hosts:214
Matching host key in /home/axelle/.ssh/known_hosts:251
Are you sure you want to continue connecting (yes/no)? yes
github.com的密钥有问题。我真的不喜欢这样,但是github.com的IP地址似乎是正确的。所以我答应了

debug1: Authentication succeeded (none).
Authenticated to github.com ([192.30.253.112]:22).
对github.com的身份验证成功。那很好。所以我进去了

但是,它不工作,连接关闭

debug1: Entering interactive session.
debug1: pledge: network
debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t3 r-1 i0/0 o0/0 fd 4/5 cc -1)

debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Connection to github.com closed by remote host.
Transferred: sent 1552, received 900 bytes, in 0.0 seconds
Bytes per second: sent 13257759.3, received 7688133.6
debug1: Exit status -1
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
请注意,在github.com设置上,我的SSH密钥具有读/写权限

添加完整日志:

debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [192.30.253.112] port 22.
debug1: Connection established.
debug1: identity file /home/axelle/.ssh/id_rsa_me type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/axelle/.ssh/id_rsa_me-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1: Remote protocol version 2.0, remote software version libssh_0.7.0
debug1: no match: libssh_0.7.0
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to github.com:22 as 'git'
debug3: hostkeys_foreach: reading file "/home/axelle/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/axelle/.ssh/known_hosts:251
debug3: load_hostkeys: loaded 1 keys from github.com
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256
debug2: host key algorithms: ssh-dss,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes192-cbc,aes128-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes192-cbc,aes128-cbc
debug2: MACs ctos: hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib,zlib@openssh.com
debug2: compression stoc: none,zlib,zlib@openssh.com
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:9g8dMOwh2s2BYc389iSRGpPAdllR+8Um/36pJucm+Ks
debug3: hostkeys_foreach: reading file "/home/axelle/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/axelle/.ssh/known_hosts:251
debug3: load_hostkeys: loaded 1 keys from github.com
debug3: hostkeys_foreach: reading file "/home/axelle/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/axelle/.ssh/known_hosts:214
debug3: load_hostkeys: loaded 1 keys from 192.30.253.112
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/axelle/.ssh/known_hosts:251
Warning: the RSA host key for 'github.com' differs from the key for the IP address '192.30.253.112'
Offending key for IP in /home/axelle/.ssh/known_hosts:214
Matching host key in /home/axelle/.ssh/known_hosts:251
Are you sure you want to continue connecting (yes/no)? yes
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug2: key: /home/axelle/.ssh/id_rsa_me (0x55d7be959740), explicit
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug1: Authentication succeeded (none).
Authenticated to github.com ([192.30.253.112]:22).
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Entering interactive session.
debug1: pledge: network
debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t3 r-1 i0/0 o0/0 fd 4/5 cc -1)

debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Connection to github.com closed by remote host.
Transferred: sent 1552, received 900 bytes, in 0.0 seconds
Bytes per second: sent 13257759.3, received 7688133.6
debug1: Exit status -1
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
debug2:解析“github.com”端口22
debug2:ssh\u connect\u direct:needpriv 0
debug1:连接到github.com[192.30.253.112]端口22。
debug1:已建立连接。
debug1:identity file/home/axelle/.ssh/id\u rsa\u me类型1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/axelle/.ssh/id\u rsa\u me-cert type-1
debug1:启用协议2.0的兼容模式
debug1:本地版本字符串SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1:远程协议版本2.0,远程软件版本libssh_0.7.0
debug1:不匹配:libssh_0.7.0
调试2:fd 3设置O_非块
debug1:正在以“git”身份向github.com:22进行身份验证
debug3:hostkeys\u foreach:reading文件“/home/axelle/.ssh/known\u hosts”
debug3:record_hostkey:在文件/home/axelle/.ssh/known_hosts:251中找到密钥类型RSA
debug3:load_主机密钥:从github.com加载1个密钥
debug3:order\u hostkeyalgs:preference hostkeyalgs:ssh rsa证书-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh rsa
debug3:发送数据包:类型20
debug1:SSH2\u MSG\u KEXINIT已发送
debug3:接收数据包:类型20
debug1:SSH2\u MSG\u KEXINIT已收到
调试2:本地客户科欣IT提案
debug2:KEX算法:curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2:主机密钥算法:ssh rsa证书-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2:密码ctos:chacha20-poly1305@openssh.com,aes128中心,aes192中心,aes256中心,aes128-gcm@openssh.com,aes256-gcm@openssh.com、aes128 cbc、aes192 cbc、aes256 cbc、3des cbc
debug2:密码stoc:chacha20-poly1305@openssh.com,aes128中心,aes192中心,aes256中心,aes128-gcm@openssh.com,aes256-gcm@openssh.com、aes128 cbc、aes192 cbc、aes256 cbc、3des cbc
调试2:MACs CTO:umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
调试2:MACs stoc:umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
调试2:压缩CTO:无,zlib@openssh.com,zlib
调试2:压缩stoc:无,zlib@openssh.com,zlib
调试2:语言CTO:
调试2:语言stoc:
debug2:第一个_kex_跟随0
debug2:保留0
debug2:对等服务器KEXINIT提案
debug2:KEX算法:curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256
debug2:主机密钥算法:ssh-dss、ssh-rsa
debug2:密码ctos:chacha20-poly1305@openssh.com,aes256中心线,aes192中心线,aes128中心线,aes192 cbc,aes128 cbc
debug2:密码stoc:chacha20-poly1305@openssh.com,aes256中心线,aes192中心线,aes128中心线,aes192 cbc,aes128 cbc
调试2:MACs CTO:hmac-sha2-256、hmac-sha2-512、hmac-sha1
调试2:MACs stoc:hmac-sha2-256、hmac-sha2-512、hmac-sha1
debug2:压缩CTO:无,zlib,zlib@openssh.com
debug2:压缩stoc:无,zlib,zlib@openssh.com
调试2:语言CTO:
调试2:语言stoc:
debug2:第一个_kex_跟随0
debug2:保留0
debug1:kex:算法:curve25519-sha256@libssh.org
debug1:kex:主机密钥算法:ssh-rsa
debug1:kex:server->client cipher:chachacha20-poly1305@openssh.comMAC:压缩:无
debug1:kex:client->server cipher:chachacha20-poly1305@openssh.comMAC:压缩:无
debug3:发送数据包:类型30
debug1:需要SSH2\u MSG\u KEX\u ECDH\u回复
debug3:接收数据包:类型31
debug1:服务器主机密钥:ssh rsa SHA256:9g8dMOwh2s2BYc389iSRGpPAdllR+8Um/36pJucm+Ks
debug3:hostkeys\u foreach:reading文件“/home/axelle/.ssh/known\u hosts”
debug3:record_hostkey:在文件/home/axelle/.ssh/known_hosts:251中找到密钥类型RSA
debug3:load_主机密钥:从github.com加载1个密钥
debug3:hostkeys\u foreach:reading文件“/home/axelle/.ssh/known\u hosts”
debug3:record_hostkey:在文件/home/axelle/.ssh/known_hosts:214中找到密钥类型RSA
debug3:load_hostkeys:从192.30.253.112加载了1个密钥
debug1:主机“github.com”已知并与RSA主机密钥匹配。
debug1:在/home/axelle/.ssh/known_hosts:251中找到密钥
警告:“github.com”的RSA主机密钥与IP地址“192.30.253.112”的密钥不同
/home/axelle/.ssh/known_hosts中的IP密钥有问题:214
在/home/axelle/.ssh/known_hosts中匹配主机密钥:251
是否确实要继续连接(是/否)?对
debug3:发送数据包:类型21
调试2:设置新键:模式1
黛布
Warning: the RSA host key for 'github.com' differs from the key for the IP address '192.30.253.112'