1

While trying to set up a loop back ssh I am getting prompted for a password after a pub key install, this is a CentOS 6.4 server. ssh_config (grep -v ^# /etc/ssh/sshd_config | grep -v ^$) is here: http://pastebin.com/Wg6iuL3x

The two users involved are root and git

# clean root dir
cd ~/.ssh/ && rm -f $(ls | grep -i 'rsa\|dsa')
echo '' > known_hosts

# clean git dir
/home/git/.ssh/ && rm -f $(ls | grep -v 'authorized_keys')
chmod 0700 /home/git/.ssh && chmod 0600 /home/git/.ssh/authorized_keys
echo '' > authorized_keys

# back to root
ssh-keygen -f ~/.ssh/git_dsa -t dsa -N ''
cat ~/.ssh/git_dsa.pub >> /home/git/.ssh/authorized_keys

ssh -vvv git@localhost
git@localhost's password: 
...

Here's the -v log

debug1: Next authentication method: publickey
debug1: Offering public key: git.rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Offering public key: git.dsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password

The -vvv log is here: http://pastebin.com/j7iGvvMH

NOTE

this does not look like its seeing/recognizing the git_dsa.pub key, I'm sure that is the root of the problem?

2 Answers 2

2

You probably have problems with SELinux. Assuming you have emphasis on security (you are working on a loopback ssh after all) and do not want to disable it, do the following as root:

 restorecon -R -v /home/git/.ssh

If you do want to disable it after all, then edit /etc/selinux/config and set SELINUX=permissive in it.

1
  • I had to reset SeLinux then retorecon on both root and git, works after that. +1 and accepted
    – ehime
    Nov 15, 2013 at 19:38
1

You haven't told ssh to use the git_dsa key:

ssh -i /root/.ssh/git_dsa git@localhost

Or edit /root/.ssh/config and add an appropriate IdentityFile directive.

3
  • Didn't seem to work pastebin.com/QX8reUem
    – ehime
    Nov 15, 2013 at 18:57
  • updated with vvv
    – ehime
    Nov 15, 2013 at 19:00
  • Plus one for a good point though
    – ehime
    Nov 15, 2013 at 19:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .