I am trying to have a git server on my raspberry pi that is passwordless with only ssh key authetication.
Sshing in with ssh key works fine, although when I try to push to a repository this is the message I get
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
No there is a fix to this, if in sshd_config I set:
PasswordAuthentication yes
This fixes it, although it will ask me a password
What I have done:
I have created a user git, (I tried sudo and non sudo), I have added correctly the ssh key and correctly the private key on the machine trying to push (this was verified by ssh correctly into the pi).
What has not worked: Using:
sudo passwd -d git
This will result not in a success message but in a expiring password change message, and password will still be asked making the user git unaccessible
PermitEmptyPasswords yes
Does not work
PubkeyAuthentication yes
Does not work
RSAAuthentication yes
Does not work
- Making git sudo
Does not work
- Adding the public ssh key and associating it with git with ssh -i
Does not work