So I am trying to get git to work with my repo server (184.108.40.206) (debian) on my new server on AWS (220.127.116.11 / 10.0.0.111).
My repo's .git/config
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [branch "master"] remote = origin merge = refs/heads/master [remote "origin"] url = email@example.com:/opt/git/repo.git fetch = +refs/heads/*:refs/remotes/origin/*
I'm getting this error:
[ec2-user@ip-10-0-0-111 html]$ sudo git pull Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
My public key is present in /home/git/.ssh/authorized_keys
I previously I was prompted for the password for the user git on my repo server (not my key file passphrase). I then disabled password auth for the git user, and received the permission denied instead. During this time and now with the error above I was able to successfully login via ssh:
With no password prompt or such:
debug1: Offering RSA public key: /home/ec2-user/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 279 debug1: Authentication succeeded (publickey).
A successful ssh login on the repo server (18.104.22.168) looks like this in the /var/log/auth.log:
Feb 22 15:45:44 hostname sshd: Connection from 22.214.171.124 port 50409 Feb 22 15:45:44 hostname sshd: Found matching RSA key: <fingerprint> Feb 22 15:45:44 hostname sshd: Accepted publickey for git from 126.96.36.199 port 50409 ssh2 Feb 22 15:45:44 hostname sshd: pam_unix(sshd:session): session opened for user git by (uid=0)
When I try git pull this is what auth.log looks like:
Feb 22 15:46:41 hostname sshd: Connection from 188.8.131.52 port 50410
Then nothing more.
How can I debug the git ssh authentication failure for git when the normal ssh command works perfectly?