0

After init 1, the ssh connexion on a remote server was interrupted with the following error

packet_write_wait: Connection to UNKNOWN port 0: Broken pipe

Now, even root cannot connect

$ ssh root@remoteserver
ssh: connect to host remoteserver port 22: Connection refused

Is there any way to recover a ssh connexion?

0

Switching to runlevel 1 kills all processes (except the top-level init/upstart command itself), including the SSH daemon.

From http://www.debianadmin.com/debian-and-ubuntu-linux-run-levels.html:

Run Level 1 is known as ‘single user' mode. A more apt description would be ‘rescue', or ‘trouble-shooting' mode. In run level 1, no daemons (services) are started. Hopefully single user mode will allow you to fix whatever made the transition to rescue mode necessary.

The easiest way to get sshd running is to switch to a runlevel that starts it by default. In Ubuntu, that's any of 2, 3, 4 and 5.

If you can't access the single-user shell to enter the init or telinit command, eg. because you were connected remotely, or it's hidden by the splash screen, then you're out of luck. The only option left is to reboot.

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.