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?

2
  • 4
    Probably not - runlevel 1 doesn't provide networking. Which unix/linux distribution are you using? Commented Feb 10, 2017 at 10:53
  • It is Ubuntu 14.04. Commented Feb 12, 2017 at 9:14

1 Answer 1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.