Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running ubuntu 13.10 (fresh install). I have installed openssh-server. During the process of trying to troubleshoot a problem with logging in via ssh from another linux system (also running ubuntu) I discovered that stopping and starting the server don't seem to work properly. I have googled the problem extensively and found many (sometimes conflicting) answers. Below are the results for the four methods I have found

root@newton:~# invoke-rc.d ssh stop

initctl: Unknown job: ssh

root@newton:~# service ssh stop

stop: Unknown job: ssh

root@newton:~# /etc/init.d/ssh stop

root@newton:~# 

root@newton:~# stop ssh

stop: Unknown job: ssh

In no case do I get feedback that indicates the daemon stopped. The same goes for trying to start the daemon. When I look at /var/log/auth.log I see that the daemon apparently stopped multiple times but not because of the above commands. It only stops when I kill it using killall sshd. After which it immediately restarts. Somehow something appears to be completely broken with my system. Does anyone have any ideas on how to sort it out? Thanks for any help.

share|improve this question
    
can you try ls /etc/init.d/ssh ? –  OYRM Jan 10 at 5:33
    
Here is the result of ls -l /etc/init.d/ssh: -rwxr-xr-x 1 root root 4077 May 21 2013 /etc/init.d/ssh –  user234017 Jan 10 at 6:27
    
How about sudo service ssh status ? –  OYRM Jan 10 at 6:36
    
Can you try sudo apt-get -reinstall install openssh-server? –  i08in Jan 10 at 8:01
    
@OYRM and Jobin I posted an answer. I just wanted to let you know. Thanks for your help. –  user234017 Jan 10 at 18:42
add comment

2 Answers 2

Thanks to all who have posted trying to help me sort this out. I wanted to update all on the current status and explain what I did to put the system in its current state. You will notice in the original post that I tried sudo service ssh start, etc. and obtained various unhelpful errors. Eventually, I did

#touch /etc/ssh/sshd_not_to_be_run

and then

# killall sshd

a few times. At this point sshd stopped restarting (as you would expect). I then ran

sudo service ssh status
ssh stop/waiting  

sudo service ssh start  
ssh stop/pre-start, process 22510  

sudo service ssh status  
ssh stop/waiting  

sudo service ssh stop  
stop: Unknown instance:   

sudo service ssh status  
ssh stop/waiting  

sudo service ssh start    
ssh stop/pre-start, process 22579    

sudo service ssh status    
ssh stop/waiting

These results are expected given the presence of sshd_not_to_be_run file. After subsequently removing this file I was able to run:

sudo service ssh status
ssh stop/waiting

sudo service ssh start
ssh start/running, process 25063

sudo service ssh status
ssh start/running, process 25063

sudo service ssh stop
ssh stop/waiting

sudo service ssh start
ssh start/running, process 25141

sudo service ssh status
ssh start/running, process 25141

sudo service ssh stop
ssh stop/waiting

sudo service ssh start
ssh start/running, process 25247

It looks like things are in order for now. If anyone has any ideas about tests that I could to to help ubuntu sort this out (I have seen several other posts on the web that indicate the errors I was originally getting) I would be happy to do them and post results. Thanks again for all of your help.

share|improve this answer
1  
how creating the file /etc/ssh/sshd_not_to_be_run is supposed to help ? I have exactly the same issue, and your solution doesn't work ! –  vcarel Apr 22 at 12:50
add comment

try

service sshd stop
service sshd start
share|improve this answer
    
stop: Unknown job: ssh –  vcarel Apr 22 at 12:51
    
start: Unknown job: ssh –  vcarel Apr 22 at 12:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.