I use public keys to authenticate with OpenSSH/ I don't allow passwords. When I look in the /var/log/auth.log logfile I have the following errors:
I have checked the permissions in my home directory and they are as follows:
After following all the articles online about permissions I still can't get rid of that error when authenticating. Any ideas? What I find interesting is that it authenticates me fine with the key in /home/user/.ssh/authorized_keys but it complains about /usr/home/user/.ssh/authorized_keys?
The other issue I have is, when I restart the SSH service I get the following:
I had a look in /etc/ssh and have the following:
In sshd_config I have:
The funny thing is I can SSH into the server fine and Putty says I am connected using SSH 2 so why the errors when I restart the service?
Code:
pam_ssh_agent_auth: Authentication refused: bad ownership or modes for file /usr/home/user/.ssh/authorized_keys
pam_ssh_agent_auth: matching key found: file /home/user/.ssh/authorized_keys, line 1
pam_ssh_agent_auth: Found matching RSA key: 0c:64:1e:49:97:3a:d0:a1:09:0c:e0:25:67:fb:c8:4a
pam_ssh_agent_auth: Authenticated: `user' as `user' using /home/user/.ssh/authorized_keys
I have checked the permissions in my home directory and they are as follows:
Code:
drwxr-xr-x 6 user user 17B Jan 24 18:01 user/
drwx------ 2 user user 3B Jan 1 17:32 .ssh/
-rw------- 1 user user 390B Jan 4 14:47 authorized_keys
After following all the articles online about permissions I still can't get rid of that error when authenticating. Any ideas? What I find interesting is that it authenticates me fine with the key in /home/user/.ssh/authorized_keys but it complains about /usr/home/user/.ssh/authorized_keys?
The other issue I have is, when I restart the SSH service I get the following:
Code:
Performing sanity check on sshd configuration.
Could not load host key: /etc/ssh/ssh_host_rsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
I had a look in /etc/ssh and have the following:
Code:
-rw-r--r-- 1 root wheel 236K Sep 27 11:34 moduli
-rw-r--r-- 1 root wheel 1.7K Jan 21 17:43 ssh_config
-rw------- 1 root wheel 668B Jan 1 12:25 ssh_host_dsa_key
-rw-r--r-- 1 root wheel 612B Jan 1 12:25 ssh_host_dsa_key.pub
-rw------- 1 root wheel 227B Jan 1 12:25 ssh_host_ecdsa_key
-rw-r--r-- 1 root wheel 184B Jan 1 12:25 ssh_host_ecdsa_key.pub
-rw------- 1 root wheel 539B Jan 1 12:25 ssh_host_key
-rw-r--r-- 1 root wheel 344B Jan 1 12:25 ssh_host_key.pub
-rw------- 1 root wheel 1.6K Jan 1 12:25 ssh_host_rsa_key
-rw-r--r-- 1 root wheel 404B Jan 1 12:25 ssh_host_rsa_key.pub
-rw-r--r-- 1 root wheel 4.8K Feb 1 10:07 sshd_config
In sshd_config I have:
Code:
ListenAddress 192.168.0.240
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
SyslogFacility AUTH
LogLevel DEBUG
LoginGraceTime 15
PermitRootLogin no
StrictModes yes
MaxAuthTries 3
Ciphers aes256-ctr
RSAAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
RhostsRSAAuthentication no
HostbasedAuthentication no
IgnoreRhosts yes
PasswordAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
KerberosAuthentication no
GSSAPIAuthentication no
AllowUsers user
AllowAgentForwarding yes
AllowTcpForwarding yes
PrintLastLog yes
TCPKeepAlive yes
Subsystem sftp /usr/libexec/sftp-server
HPNDisabled no
HPNBufferSize 2048
UseDNS no
The funny thing is I can SSH into the server fine and Putty says I am connected using SSH 2 so why the errors when I restart the service?