I'm trying to set up SSH host keys from our Mac OS X 10.5 Leopard Server-based central backup server to our two Linux servers running Fedora 10 and CentOS 5.2. The process we usually take works and puts the key in ~/.ssh/authorized_keys, but it still prompts for the password.
I'm not the regular admin of these boxes and I understand the default is probably to have SSH host keys disabled. How do enable SSH host keys?
Update: I had already uncommented 'PubkeyAuthentication yes' in /etc/ssh/ssd_config and ran
service restart sshd, but that didn't work. Uncommented all three lines ('RSAAuthentication', 'PubkeyAuthentication', and 'AuthorizedKeysFile'), corrected permissions on ~/.ssh and tried again. Still no love.
When I run
ssh -v user@host I get the following before it prompts for a password and after some GSS errors:
debug1: Next authentication method: publickey debug1: Trying private key: /Users/shortname/.ssh/identity debug1: Trying private key: /Users/shortname/.ssh/id_rsa debug1: Trying private key: /Users/shortname/.ssh/id_dsa debug1: Next authentication method: password
Another Update: Permissions on
~/.ssh/ are 700.
The command I've been running to create the host key is as follows:
cat /blah/ssh_keys_for_shortname/id_dsa.pub | ssh -l shortname -o stricthostkeychecking=no -i /blah/ssh_keys_for_shortname/id_dsa host.domain.tld 'cat - >> ~/.ssh/authorized_keys'
And when attempting to connect I use:
ssh --verbose -l shortname -o stricthostkeychecking=no -i /blah/ssh_keys_for_shortname/id_dsa host.domain.tld
So, obviously we're using DSA keys. I've tried renaming
~/.ssh/authorized_keys2, but that doesn't help.
I'd love to store the keys in their default locations instead of
/blah/ssh_keys_for_shortname/, but it's out of my control.
When I watch
/var/log/audit/audit.log and try to connect, I get the following:
type=CRED_DISP msg=audit(1249426114.642:128): user pid=10589 uid=0 auid=501 ses=14 msg='op=PAM:setcred acct="shortname" exe="/usr/sbin/sshd" (hostname=host.domain.tld, addr=192.168.1.149, terminal=ssh res=success)' type=USER_END msg=audit(1249426114.647:129): user pid=10589 uid=0 auid=501 ses=14 msg='op=PAM:session_close acct="shortname" exe="/usr/sbin/sshd" (hostname=host.domain.tld, addr=192.168.1.149, terminal=ssh res=success)' type=USER_LOGIN msg=audit(1249426129.524:130): user pid=10633 uid=0 auid=4294967295 ses=4294967295 msg='acct="shortname": exe="/usr/sbin/sshd" (hostname=?, addr=192.168.1.149, terminal=sshd res=failed)'