Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just installed Debian 6, after reboot sshd stopped responding. I put the default config file but it not help. In the logs (/var/log/auth,syslog) no errors. I think the problem is that sshd not start. How can I try to run it? maybe do something in the startup scripts? Unfortunately I do not have physical access to my virtual machine, and can only reload it and view/edit the files in the filesystem.

[ added ]

Oh, thanks all. I found the problem.

Added /usr/sbin/sshd -e 2>/tmp/sshd_error to crontab

And get: /bin/sh: /usr/sbin/sshd: No such file or directory

Vaguely I could not understand where to lost a binary file on a freshly installed machine and I could work without it.

But now another question: how can I restore it?

share|improve this question

4 Answers 4

up vote 0 down vote accepted

You can start sshd by hand with exec /usr/sbin/sshd -D to see if sshd works in general. If it does, a update-rc.d ssh defaults should create the init.d symlinks as required.

share|improve this answer
    
I have no shell access to the server. Can only reload server and view/edit the files. Maybe I can write something in the startup scripts? –  vlad Jun 12 '11 at 19:21
    
no shell access? oh oh... does the /etc/init.d/ssh script exist? If it does (and if it contains the exec /usr/sbin/sshd call), take a look into the /etc/rc[0-6].d directories if there's a symlink. if there's no symlink, you could try to copy the script into /etc/rc3.d/, rename it to S16ssh (for example) and see if it's executed after a reboot. –  tohuwawohu Jun 12 '11 at 19:42
    
@vlad: IMHO the best solution would be to re-install debian from scratch. If sshd is missing completely, most likely its dependencies are missing, too. Maybe other vital components are also missing, so i think it doesn't make much sense trying to repair that system manually. –  tohuwawohu Jun 13 '11 at 7:49
    
Thanks. It turned out that it was a problem hosting company, they use a common packages (like sshd and etc) for all virtual machines and they have something broken. –  vlad Jun 13 '11 at 12:35

Set the log level to DEBUG in sshd configuration.

LogLevel DEBUG
share|improve this answer

You can run sshd in debug mode using the -d switch. This causes sshd to stay in the foreground and print messages to the console. You can increase the volume of log messages by adding more -d's

/usr/sbin/sshd -d

for normal logging

/usr/sbin/sshd -ddd 

for lots of logging.

share|improve this answer
    
Unfortunately I have no shell access to the server. Can only reload server and view/edit the files. –  vlad Jun 12 '11 at 19:20

Maybe ssh isn't activated at boot? See if there are pointers in /etc/rc.d to /etc/init.d/ssh. Alternatively, it may not start if the ssh main key is missing. Check if /etc/ssh/ssh_host*key are present.

share|improve this answer

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.