Git cloning with ssh not possible

So for some reason I cant pull from my git repos anymore. I have the remotes as ssh keys. I already deleted them, and added new keys to my github account. Its the only ssh key I have so it definitely cant pick the wrong private key. with a simple ssh command I can connect to github, verifying that it works but when I try to pull or clone a repo I get a fatal: Could not read from remote repository
i also tried the whole thing with eval $(ssh-agent) and ssh-add but still doesn’t work

This is the whole output im getting when trying to clone something

❯ GIT_SSH_COMMAND="ssh -v" 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 /etc/ssh/ssh_config
debug1: Connecting to github.com [140.82.121.4] port 22.
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: identity file /home/lukas/.ssh/id_ecdsa type -1
debug1: identity file /home/lukas/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/lukas/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/lukas/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/lukas/.ssh/id_ed25519 type -1
debug1: identity file /home/lukas/.ssh/id_ed25519-cert type -1
debug1: identity file /home/lukas/.ssh/id_ed25519_sk type -1
debug1: identity file /home/lukas/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/lukas/.ssh/id_xmss type -1
debug1: identity file /home/lukas/.ssh/id_xmss-cert type -1
debug1: identity file /home/lukas/.ssh/id_dsa type -1
debug1: identity file /home/lukas/.ssh/id_dsa-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
debug1: Authenticating to github.com:22 as 'git'
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: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
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
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
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
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: 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 agent
debug1: Will attempt key: /home/lukas/.ssh/id_ecdsa
debug1: Will attempt key: /home/lukas/.ssh/id_ecdsa_sk
debug1: Will attempt key: /home/lukas/.ssh/id_ed25519
debug1: Will attempt key: /home/lukas/.ssh/id_ed25519_sk
debug1: Will attempt key: /home/lukas/.ssh/id_xmss
debug1: Will attempt key: /home/lukas/.ssh/id_dsa
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>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/lukas/.ssh/id_rsa RSA SHA256:H5JDypggyIaxAREi4UWYhGooW09RafD9qMw4oyJGxEY agent
debug1: Server accepts key: /home/lukas/.ssh/id_rsa RSA SHA256:H5JDypggyIaxAREi4UWYhGooW09RafD9qMw4oyJGxEY agent
Authenticated to github.com ([140.82.121.4]:22) using "publickey".
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching /home/lukas/.ssh/known_hosts for github.com / (none)
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
debug1: client_input_hostkeys: no new or deprecated keys from server
debug1: Sending environment.
debug1: channel 0: setting env GIT_PROTOCOL = "version=2"
debug1: Sending command: git-upload-pack 'OverloaderV/Web-Praktikum.git'
debug1: client_input_global_request: rtype keepalive@openssh.com want_reply 1
 debug1: channel 0: free: client-session, nchannels 1
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.

At this point the things I can think of that could be at fault are: The packaged version of git and/or ssh provided by endeavor/arch or the upstream of git or openssh

When cloning, you need to use

git clone https://github.com/OverloaderV/web-Praktikum.git

I tested the above command and it worked as expected.

Pudge

EDIT:
Where are my manners? Welcome to the EndeavourOS forum. I hope you enjoy your time here.

thats cloning with http but what im reporting is that cloning with ssh doesn’t work

I use ssh to access github every day.

Are you sure it isn’t a github configuration issue?

As far as I know, there is no cloning with SSH. Every example I have ever seen uses http.

OK, I did a duckduckgo search and evidently it is possible but is a lot more involved than just typing in the http command

Pudge

Yes, but if you want to be able to push your changes back in the other direction, it is a lot easier with ssh.

Yep, I use git push, git pull, and other git commands via SSH everytime I update the EnOS ARM package repositories. Works like a charm. But I have not ever did a git clone via ssh.

Pudge

It worked for > A year and suddenly stopped working now
I deleted my ssh kes, generated new ones and put the public key on github.
I can connect to github with ssh to test the connection

❯ ssh git@github.com
PTY allocation request failed on channel 0
Hi OverloaderV! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

But when trying to clone or pull a repo i get the error from above

Its not only github but gitlab too

There is no difference between doing a git clone via ssh and doing a git pull via ssh.

If you clone via https and then use ssh to push/pull/tag/etc, it is just extra work on your side.

I am going to pull a @ricklinux on this one. I know the know way I do it and I’m going to stick with it. :face_holding_back_tears:

Pudge

I have my key identified in .ssh/config

Host github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/"my_github_key" #no quotes for actual key

Then I just do

git clone git@github.com:"project_i_want" #no quotes for actual project

I now have this in my .ssh/config

Host github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa

but when trying to do a git clone i still get the same result

Perhaps the issue is on the github side? What rights does the user you applied that key to have to the repo?

Its the owner. and It happens for every repo. not only github repos but also gitlab repos

can you post the output of git clone command with the command itself?

isnt that the output that i already posted in the first post?

this is the output with verbose flags

just post output of this

git clone git@github.com:OverloaderV/Web-Praktikum.git

Give me a bit, it takes ages to fail
its hangs on

❯ git clone git@github.com:OverloaderV/Web-Praktikum.git
Cloning into 'Web-Praktikum'...

everything else that it spits out is if i remember correctly this part

Are you behind a proxy/tor/vpn?