I have a (virtual) server running an Ubuntu 10.04 minimal system. I seem to have misconfigured sshd so that it does not start up on reboot. Since this is a server, I now do not have shell access to my server anymore. Any ssh request results in this:
ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused
And /var/run/sshd.pid
does not exist.
I do have access to the file system through a Virtuozzo Panel the server provider has installed.
I have not edited the /etc/init.d/ssh
start script but I did copy it to /etc/rc2.d/ssh
in hopes that this would start ssh at reboot.
I also tried adding a startup call to /etc/crontab
:
7 * * * * root /usr/bin/touch /root/cron_is_running
8 * * * * root /etc/init.d/ssh start
Neither do I get the file /root/cron_is_running
nor is sshd
starting up
My logfiles do not provide much in the way of error messages for ssh, f.e. /var/log/syslog
only shows a lot of named
stuff at startup and some mysql
upgrade stuff, that is surely not related.
I appreciate any help, I already configured a bunch of things on that server and by installing a new image I would loose all data on the server.
Update: Changing the script in /etc/rc2.d/ssh
to /etc/rc2.d/S90ssh
did not have any effect. /var/log/auth.log
does not contain any lines that hint at ssh trying to start up, it is full of these lines however:
Update 2: As suggested I also tried adding /usr/sbin/sshd
to /etc/rc.local
. But a test with touch /tmp/test
seems to suggest this file is not executed despite +x flag being set. I also tried adding sleep 10
at the beginning of the rc.local
script because it was suggested elsewhere that this script had concurrency issues.
Final Update
Thanks to the below answers again. They were huge help in fixing the missing sshd startup in the rcX.d/
directories. The final fix was to start a "Repair" from the Virtuozzo Panel, this mounts the original system as part of the filesystem of a recovery system with the original network settings. I could log into that with ssh. I copied the working ssh configs from the recovery system over the ssh configs of the broken original system, finished the recovery and now I can log in again.