I'm trying to clone a private Github repo from my linux Mint computer using ssh.
I have created a private/public key pair and registered it with Github (different than the default id_rsa).
When I try ssh -vT [email protected]
, I have successful authentication.
But when I make a git clone using the URL given by GitHub, I get the following error :
git clone [email protected]:benblan/{private_repo}.git
Cloning into '{private_repo}'...
[email protected]: No such file or directory
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The ssh-agent is running.
ps -eaf | grep ssh
benblan 1525 1455 0 09:58 ? 00:00:00 /usr/bin/ssh-agent /usr/bin/im-launch cinnamon-session-cinnamon
benblan 2109 1452 0 09:59 ? 00:00:00 /usr/bin/ssh-agent -D -a /run/user/1000/keyring/.ssh
The only thing I see is that when I echo the variable SSH_AUTH_SOCK, I have a different path : /run/user/1000/keyring/ssh (no dot in front of ssh).
I could use HTTPS with Personal Access Token, but I wanted to make the ssh connection work.
Any idea?
CodePudding user response:
Double-check your ssh client is fully installed/up-to-date:
sudo apt update
sudo apt install openssh-client
And specify the full path for ssh and your key:
export GIT_SSH_COMMAND="/usr/bin/ssh -i ~/.ssh/id_rsa"
Then try again.