I have 3 public ssh keys that correspond to 3 users that work on my server. I need to use those 3 public keys for the git user on my server, so that they can access git repositories on the server.
I ran the following in an attempt to make the git user accessible via ssh:
cat /home/user_one/.ssh/authorized_keys >> /var/git/.ssh/authorized_keys
cat /home/user_two/.ssh/authorized_keys >> /var/git/.ssh/authorized_keys
cat /home/user_three/.ssh/authorized_keys >> /var/git/.ssh/authorized_keys
However, we get a [email protected]: Permission denied (publickey) error when trying to ssh in as the git user, or trying to push to a git repository.
Notes: /var/git is the home directory of the git user. The server is on Debian 11.
We can connect to each of the users individually, why can't we connect to the git user?
.sshdir was755, changed it to700and the home directory/var/gitneeded to be changed to755from775, these together seemed to have solved it.