-3

I have a private debian VPS hosting my git repositories.

My ssh-agent is running (on Windows) and my private key identity is added.

Adding the remote url doesn't cause a problem :

git remote add origin user@my_git_server:/home/user/git_repo //<-ok

If I use GitHub Desktop GUI client, everything is fine : I can publish / pull / push...

The problem : I want to do the same but on the command line.

Example :

$ git push origin master
user@my_git_server: Permission denied (publickey).
fatal: Could not read from remote repository.

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

It seems the SSH authentication is not done. What am I missing ?

PinkTurtle
  • 6,942
  • 3
  • 25
  • 44

1 Answers1

-2

I found the solution here : How to specify the private SSH-key to use when executing shell command on Git?

In short : create a config file in the current user .ssh folder, adding the VPS hostname along with the path to the private key.

PinkTurtle
  • 6,942
  • 3
  • 25
  • 44