When I attempt to execute any commands such as /etc/init.d/ssh restart or /etc/init.d/ssh start, I get no output. It just goes to the next command line (Ubuntu Hardy). I can even pass in junk parameters such as /etc/init.d/ssh asldkfjalskfdj and i get no warnings or error messages, it just goes to the next line. I can check in my processes:

lsof -i :22

and don't see my ssh process. I also don't see my SSH process when i run:

netstat -na --inet

Any troubleshooting suggestions?

THANK YOU ALL SO MUCH!! I have no idea how i got rid of it, but apparently i killed my SSH install. A quick sudo apt-get install ssh openssh-server did the trick!! I really appreciate you all taking time out of your day to help me out!

  • 1
    try sudo apt-get install openssh-server – Journeyman Geek Mar 23 '10 at 7:04

The script will exit immediately if the /usr/sbin/sshd binary can not be found and executed. Can you ls -l /usr/bin/sshd?

  • I don't have a /usr/bin/sshd though i do have a /usr/bin/ssh, the output of /usr/bin/sshd is: -rwxr-xr-x 1 xuserx xuserx 316640 2008-05-14 14:39 /usr/bin/ssh – Schneems Mar 23 '10 at 2:19
  • In that case you're missing the actual sshd daemon. Reinstall the openssh-server package. – theotherreceive Mar 23 '10 at 9:18

When attempting to debug what a shell program is doing, you can use the set -x option to instruct the shell to display each expanded command before it executes the command:

$ sudo /etc/init.d/ssh foo
$ sudo sh -x /etc/init.d/ssh foo
+ set -e
+ test -x /usr/sbin/sshd
+ umask 022
+ export SSHD_OOM_ADJUST=-17
+ test -f /etc/default/ssh
+ . /etc/default/ssh
  • Output is as follows. Looks like i don't have a /usr/sbin/sshd. I have no clue how i could have accidentally deleted it. Any clue how I might go about getting back my long lost file? +set-e / + test -x /usr/sbin/sshd / + exit 0 / – Schneems Mar 23 '10 at 2:23

Try starting it in debug mode and look for errors.

sudo /usr/sbin/sshd -def /etc/ssh/sshd_config
  • looks like i don't have a /usr/sbin/sshd file which is most likely part of the problem. This server has worked for the last ~6 months, and last time i was in it i certainly didn't go around deleting files in my usr/sbin folder, no matter...though i would like to have the file back. Any suggestions? – Schneems Mar 23 '10 at 2:28
  • i don't use ubuntu but i think you should be able to install with "sudo apt-get install ssh" – anonymouse Mar 23 '10 at 2:42

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.