1

I have freshly installed Linux Manjaro with Plasma Desktop. Cloning my repos from Github using SSH gives me some trouble. I tried

[andreas@Bixente ~]$ ssh-add -l
Could not open a connection to your authentication agent.
[andreas@Bixente ~]$ eval "$(ssh-agent -s)"
Agent pid 5346
[andreas@Bixente ~]$ ssh-add -l
The agent has no identities.
[andreas@Bixente ~]$ ssh-add ~/.ssh/github
Identity added: /home/andreas/.ssh/github (andreas@Bixente)
[andreas@Bixente ~]$ git clone [email protected]:Username/project.git ~/TestDir
Cloning into '/home/andreas/TestDir'...
Connection closed by 140.82.121.3 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What am I doing wrong? I am sure I put the key on Github. Furthermore, it seems like I have to do this after every restart.

Edit: Nothing really works. I followed step by step, even created and used another key with default name. Still no solution.

[andreas@Bixente .ssh]$ ssh-add id_ed25519
Identity added: id_ed25519 (andreas@Bixente)
[andreas@Bixente .ssh]$ ssh -Tvvv [email protected]
OpenSSH_9.1p1, OpenSSL 3.0.7 1 Nov 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/andreas/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/andreas/.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: connect to address 140.82.121.3 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out

Edit: I followed the exact same steps to my friends machine (MacBook Air) without any problems. But I recognized, I was never asked to add Github to known_hosts.

2
  • Please write more details about your problem, All steps that you make is correct and should clone without any problem. you can solve this problem by generating ssh-key again with default name of ssh-key , copy public key to remote host and try to clone again Commented Nov 28, 2022 at 23:36
  • 140.82.121.3 is a GitHub load balancer, so everything looks OK, but obviously it's not working. The "connection closed" without any message suggests (though does not prove) an issue on their end. Use ssh -Tv [email protected] to trace any ssh traffic that actually did make it through. Commented Nov 29, 2022 at 9:59

2 Answers 2

1

Check here, to get an idea on how the cloning process works.

  • ensure that you are providing public key in the GitHub console

  • check the connection using ssh -T [email protected], in case of any errors check here

  • verify that public and private keys are present in the .ssh folder and optionally known_hosts

  • debug using ssh -vvv [email protected]

That should resolve your issue.

Sign up to request clarification or add additional context in comments.

1 Comment

0

Actually this was a hard to find Manjaro-MacBook related problem. More info see here: https://forum.manjaro.org/t/cant-use-ssh-on-freshly-installed-manjaro-with-macbook-pro-2012-wi-fi/127982/42

1 Comment

please elaborate so that people can understand the problem and resolve it without clicking the link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.