使用ssh克隆Git是不可能的



解决了:我爸爸重置了我们的路由器设置(据他说,他一开始甚至没有改变。他认为更新一定改变了它们(,现在它工作了

所以出于某种原因,我不能再从我的git repos中提取了。我把遥控器作为ssh密钥。我已经删除了它们,并向我的GitHub帐户添加了新密钥。

这是我唯一的ssh密钥,所以它绝对不会选错私钥。通过一个简单的ssh命令,我可以连接到GitHub,验证它是否工作,但当我尝试提取或克隆repo时,我会得到一个

fatal: Could not read from remote repository

我也用eval $(ssh-agent)ssh-add尝试了整个过程,但仍然无法使用

这是我在尝试克隆时得到的全部输出

❯ GIT_SSH_COMMAND="ssh -vvv" git clone git@github.com:OverloaderV/Web-Praktikum.git
Cloning into 'Web-Praktikum'...
OpenSSH_9.1p1, OpenSSL 1.1.1q  5 Jul 2022
debug1: Reading configuration data /home/lukas/.ssh/config
debug1: /home/lukas/.ssh/config line 1: Applying options for github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/lukas/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/lukas/.ssh/known_hosts2'
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [140.82.121.3] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: Connection established.
debug1: identity file /home/lukas/.ssh/id_rsa type 0
debug1: identity file /home/lukas/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.1
debug1: Remote protocol version 2.0, remote software version babeld-a0da6a28
debug1: compat_banner: no match: babeld-a0da6a28
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to github.com:22 as 'git'
debug3: record_hostkey: found key type ED25519 in file /home/lukas/.ssh/known_hosts:2
debug3: record_hostkey: found key type RSA in file /home/lukas/.ssh/known_hosts:3
debug3: record_hostkey: found key type ECDSA in file /home/lukas/.ssh/known_hosts:4
debug3: load_hostkeys_file: loaded 3 keys from github.com
debug1: load_hostkeys: fopen /home/lukas/.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
debug3: order_hostkeyalgs: have matching best-preference key type ssh-ed25519-cert-v01@openssh.com, using HostkeyAlgorithms verbatim
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: sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
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,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256
debug2: host key algorithms: ssh-ed25519,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
debug2: MACs ctos: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
debug2: MACs stoc: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
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
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
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: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug3: record_hostkey: found key type ED25519 in file /home/lukas/.ssh/known_hosts:2
debug3: record_hostkey: found key type RSA in file /home/lukas/.ssh/known_hosts:3
debug3: record_hostkey: found key type ECDSA in file /home/lukas/.ssh/known_hosts:4
debug3: load_hostkeys_file: loaded 3 keys from github.com
debug1: load_hostkeys: fopen /home/lukas/.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 ED25519 host key.
debug1: Found key in /home/lukas/.ssh/known_hosts:2
debug3: send packet: type 21
debug2: ssh_set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: ssh_set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug3: ssh_get_authentication_socket_path: path '/tmp/ssh-XXXXXXHdpn0r/agent.5543'
debug1: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: agent returned 1 keys
debug1: Will attempt key: /home/lukas/.ssh/id_rsa RSA SHA256:H5JDypggyIaxAREi4UWYhGooW09RafD9qMw4oyJGxEY explicit agent
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey
debug3: authmethod_lookup publickey
debug3: remaining preferred:
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/lukas/.ssh/id_rsa RSA SHA256:H5JDypggyIaxAREi4UWYhGooW09RafD9qMw4oyJGxEY explicit agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /home/lukas/.ssh/id_rsa RSA SHA256:H5JDypggyIaxAREi4UWYhGooW09RafD9qMw4oyJGxEY explicit agent
debug3: sign_and_send_pubkey: using publickey with RSA SHA256:H5JDypggyIaxAREi4UWYhGooW09RafD9qMw4oyJGxEY
debug3: sign_and_send_pubkey: signing using rsa-sha2-512 SHA256:H5JDypggyIaxAREi4UWYhGooW09RafD9qMw4oyJGxEY
debug3: send packet: type 50
debug3: receive packet: type 52
Authenticated to github.com ([140.82.121.3]:22) using "publickey".
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: filesystem
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: client_input_hostkeys: received RSA key SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug3: client_input_hostkeys: received ECDSA key SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM
debug3: client_input_hostkeys: received ED25519 key SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug1: client_input_hostkeys: searching /home/lukas/.ssh/known_hosts for github.com / (none)
debug3: hostkeys_foreach: reading file "/home/lukas/.ssh/known_hosts"
debug3: hostkeys_find: found ssh-ed25519 key at /home/lukas/.ssh/known_hosts:2
debug3: hostkeys_find: found ssh-rsa key at /home/lukas/.ssh/known_hosts:3
debug3: hostkeys_find: found ecdsa-sha2-nistp256 key at /home/lukas/.ssh/known_hosts:4
debug1: client_input_hostkeys: searching /home/lukas/.ssh/known_hosts2 for github.com / (none)
debug1: client_input_hostkeys: hostkeys file /home/lukas/.ssh/known_hosts2 does not exist
debug3: client_input_hostkeys: 3 server keys: 0 new, 3 retained, 0 incomplete match. 0 to remove
debug1: client_input_hostkeys: no new or deprecated keys from server
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: set_sock_tos: set socket 3 IP_TOS 0x20
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug3: Ignored env SHELL
debug3: Ignored env WINDOWID
debug3: Ignored env COLORTERM
debug3: Ignored env I3SOCK
debug3: Ignored env GIT_SSH_COMMAND
debug3: Ignored env DOTNET_ROOT
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env SSH_AGENT_PID
debug1: channel 0: setting env GIT_PROTOCOL = "version=2"
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env EDITOR
debug3: Ignored env GTK_MODULES
debug3: Ignored env XDG_SEAT
debug3: Ignored env PWD
debug3: Ignored env LOGNAME
debug3: Ignored env QT_QPA_PLATFORMTHEME
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env _
debug3: Ignored env XAUTHORITY
debug3: Ignored env MOTD_SHOWN
debug3: Ignored env GIT_EXEC_PATH
debug3: Ignored env HOME
debug3: Ignored env LANG
debug3: Ignored env ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE
debug3: Ignored env STARSHIP_SHELL
debug3: Ignored env DOTNET_BUNDLE_EXTRACT_BASE_DIR
debug3: Ignored env STARSHIP_SESSION_KEY
debug3: Ignored env ALACRITTY_SOCKET
debug3: Ignored env XDG_SESSION_CLASS
debug3: Ignored env ANDROID_HOME
debug3: Ignored env TERM
debug3: Ignored env USER
debug3: Ignored env DISPLAY
debug3: Ignored env SHLVL
debug3: Ignored env XDG_VTNR
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env BROWSER
debug3: Ignored env PATH
debug3: Ignored env ALACRITTY_LOG
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env MAIL
debug3: Ignored env ALACRITTY_WINDOW_ID
debug3: Ignored env OLDPWD
debug1: Sending command: git-upload-pack 'OverloaderV/Web-Praktikum.git'
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 32000 rmax 35000
debug3: receive packet: type 80
debug1: client_input_global_request: rtype keepalive@openssh.com want_reply 1
debug3: send packet: type 82
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 (t4 r43 i0/0 o0/0 e[write]/0 fd 4/5/6 sock -1 cc -1 io 0x01/0x00)
Connection to github.com closed by remote host.
Transferred: sent 3220, received 2528 bytes, in 780.2 seconds
Bytes per second: sent 4.1, received 3.2
debug1: Exit status -1
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

您已成功验证为无法访问OverloaderV/Web-Praktikum.git的用户。使用ssh -T git@github.com让GitHub告诉你他们相信你是谁。

您首先发送并被接受的公钥是与/home/lukas/.ssh/id_rsa关联的公钥。请注意,GitHub有一个表(存储在他们的服务器中(,它将公钥(无论其数据是什么(映射到用户名,这就是他们认为的你。

如果您需要使用不同的公钥进行身份验证,以便以其他人身份进行身份验证时,请考虑扩充.ssh/config文件,以便使用IdentitiesOnly yes选项列出特定公钥,以控制提供的密钥集及其顺序。您使用的是ssh代理,并且您的ssh当前按代理指定的顺序提供密钥。

相关内容

最新更新