Ssh connection has stopped listening on a linux server, the output of nmap is

21/tcp   open  ftp
80/tcp   open  http
199/tcp  open  smux
443/tcp  open  https
5000/tcp open  upnp
9102/tcp open  jetdirect

is there a way to enable ssh remotely?

4 Answers 4


You need access to the console of the linux machine to start the ssh service again- this may involve you logging a ticket with your hosting provider. A reboot may not fix this- if the service is not set to start on bootup.


You're probably out of luck. If those services are even close to properly configured, they're not going to give you the access that you need. You might be looking at a reboot, if nothing else works.

  • That is my initial gut feeling that I cannot skip the trip to the server room :(
    – Chris-Top
    Commented Jan 26, 2011 at 13:12
  • Agreed. Unless you're running webmin or plesk or something else that allows service control through a web interface, then you're stuck except for local console access. Commented Jan 26, 2011 at 14:28

More than likely, if SSH was working and now it's not AND it is no longer listening, then (more than likely), you do NOT need to reboot. You either need to get to the console (non SSH), log a ticket with Support with your hosting provider, or have someone console the system for you. I suspect that SSH might be hung and just needs to be restarted (sometimes you might have to kill the old ssh PID to get the restart to work, depending how bad SSH hangs - and if that doens't work, you might have to remove the SSH lock file if things really get into hand). With Linux distros, it's rare you reboot because of a software issue - theres usually many ways around it by use of command line tools.

If there is a remote reboot option, I don't recommend it, however, if it's your only way, use at your own risk.


Since you have FTP and HTTP access, if you have PHP or another scripting language on your system you could upload a document like this to give you a shell as the webserver user:

echo "starting shell<br>";
system("cd /tmp; mkfifo fifo; nc -l 2000 <fifo | bash -i &> fifo ; rm fifo");
echo "done<br>";

Unfortunately, you will not have a controlling terminal so you won't be able to run "su" to restart sshd.

You must log in to answer this question.

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