3

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?

0

4 Answers 4

0

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.

4
  • 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, 2011 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, 2011 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, 2011 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, 2011 at 12:35
1

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.

1
  • Unfortunately I have no shell access to the server. Can only reload server and view/edit the files.
    – vlad
    Jun 12, 2011 at 19:20
1

Set the log level to DEBUG in sshd configuration.

LogLevel DEBUG
1
  • What kinds of debug messages will get printed, and where?
    – Neil
    Jan 7, 2016 at 16:30
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .