Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a fresh install of Ubuntu 12.04. I'm trying to setup ssh public key authentication. Unfortunately, it refuses to work. Running the ssh client in verbose mode I can see that the public keys are being refused.

~/.ssh/authorized_keys exists and seems to have the correct permissions etc.

What I would like to do is to read the sshd log to find out what it is complaining about. But I cannot find where the sshd logs to on Ubuntu 12.04. I've tried googling and checked /var/log/auth.log and /var/log/syslog and neither are showing sshd messages. Where can I find the daemon logs to figure out what is going on?

sshd is set with logging
SyslogFacility AUTH
LogLevel VERBOSE

and /etc/rsyslog.d/50-default.conf reads:

auth,authpriv.*         /var/log/auth.log
*.*;auth,authpriv.none      -/var/log/syslog

but nothing shows up about sshd in those log files.

Also. No sshd process appears to be running if run ps xa | grep sshd. Is that normal? It certainly accepts password connections.

share|improve this question
    
It is unclear to me if you are trying to setup SSH server on your machine, or you are trying to connect to remote machine using your private key? –  Andrejs Cainikovs May 29 '12 at 17:40
    
@AndrejsCainikovs I'm trying to setup my machine as a ssh server. For testing I'm using this machine as server and client (i.e ssh localhost) which works when a password is provided, but I need key-based authentication. –  Jonathan J Hunt May 29 '12 at 17:53
    
I see. Well, if password works, then sshd is installed and works. Does the log at /var/log/auth.log say something when you connect via password? When you specify wrong password? –  Andrejs Cainikovs May 29 '12 at 19:08
    
No. No sshd logs show up in auth.log or anywhere else that I've looked. –  Jonathan J Hunt May 29 '12 at 20:56
    
My kneejerk reaction was that you must be connecting to the wrong machine, but if you're connecting to localhost, that's not very likely. Still, post the output of ssh -vv localhost, and of netstat -lnt. Do you have any virtualization going on? Any chroot? –  Gilles May 29 '12 at 21:08
show 9 more comments

1 Answer

OP answered:

In case anyone encounters this in future. For me the problem was solved by realising that lshd rather the opensshd was answering port 22. Removing lshd (apt-get remove lsh-server) fixed everything.

Thanks to @Gilles for pointing me in the right direction.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.