CentOS x64 6.5: if I connect as root to my server and do the following:

service sshd stop
/usr/sbin/ssh -d

I'll able to connect as user using public key authentication from my development machine:

ssh -v user@myserver.mydomain.com

When however I use the daemon:

service sshd start

I'm not able to connect anymore, and ssh asks for a password. tail -f /var/log/secure shows nothing.

Have you any idea why this is happening?

  • 1
    Run the client with multiple v to see more debugging info, as in -vvv. It may give you a clue. – garethTheRed Aug 9 '14 at 18:24
  • also try running "/usr/sbin/sshd -De" instead of "-d" - debug mode has several differences to normal daemon mode. – Dani_l Aug 9 '14 at 21:35
  • @Dani_l running /usr/sbin/sshd -De and trying to connect works fine: Accepted public key for user from port 55803 ssh2. But after running service sshd start, the same client can't connect. – user34295 Aug 30 '14 at 18:28

This is a Centos bug.

Deleting first line "#!/bin/bash" from /etc/init.d/sshd fixes it.


Have you looked at your processes - do they contain sshd?

ps -eF | grep ssh

Please check the output of the command mentioned above before and after stopping/starting the service. Maybe something goes wrong, when starting the daemon.

  • Nothing special after running that command. Any help? – user34295 Aug 30 '14 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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