2

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!

Zoredache
  • 128,755
  • 40
  • 271
  • 413
Schneems
  • 187
  • 3
  • 12

3 Answers3

2

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

theotherreceive
  • 8,235
  • 1
  • 30
  • 44
  • 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 02:19
  • In that case you're missing the actual sshd daemon. Reinstall the openssh-server package. – theotherreceive Mar 23 '10 at 09:18
1

Try starting it in debug mode and look for errors.

sudo /usr/sbin/sshd -def /etc/ssh/sshd_config
Scott Pack
  • 14,717
  • 10
  • 51
  • 83
anonymouse
  • 239
  • 1
  • 2
  • 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 02: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 02:42
1

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
[…]
bignose
  • 942
  • 10
  • 20
  • 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 02:23