ssh authentication works, but git doesn't

1

I am using cygwin on Windows 10.

When using ssh user@server.com ssh correctly loads my id_rsa, asks me for the passphrase and then authenticates me on the server.

However, when I try to git push ssh://user@server.com/~/repo.git, I get this error:

Permission denied (publickey).
fatal: Could not read from remote repository.

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

Doesn't git use the ssh mechanism and should therefore successfully authenticate me as well?

Frederik Abitz

Posted 2016-04-04T10:25:54.647

Reputation: 11

Answers

0

It looks like you have a wrong path to your repository. I would guess that it is:

git push ssh://user@server.com/repo.git

But you should verify that (if you have shell access) with

ssh user@server.com ls -l ~/repo.git

or

ssh user@server.com ls -l repo.git

The other possibility is that you have read-only access to that repository.

Jakuje

Posted 2016-04-04T10:25:54.647

Reputation: 7 981