Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

After installing openssh-server, the server start every time I boot. If I want it to be manual what do I need to do?

In version 0.6.7+ of upstart I would add a "manual" stanza to the job file.

10.04 has upstart 0.6.5-8. What is the preferred way to disable ssh from starting automatically in this case?

share|improve this question

6 Answers 6

Rename /etc/init/ssh.conf to /etc/init/ssh.conf.disabled.

sudo mv /etc/init/ssh.conf /etc/init/ssh.conf.disabled
share|improve this answer
Fast, easy and self-documenting. Perfect. – LeartS Jan 28 '14 at 15:47
Possibly even better than echo manual | sudo tee /etc/init/ssh.conf.override , see also how-to-enable-or-disable-services – here Jan 2 at 9:48
echo manual | sudo tee /etc/init/ssh.conf.override seems like a much better answer, because sudo mv /etc/init/ssh.conf /etc/init/ssh.conf.disabled also prevents starting the server manually without changing it back every time. – Brian Z Jun 7 at 4:19

This should be enough,:

 update-rc.d ssh enable # sets the default runlevels to on 
 update-rc.d ssh disable # sets all to off
share|improve this answer
Does this work with an upstart job or just old sys v init scripts? – komputes Aug 12 '11 at 16:12
This should be enough, even if you're using upstart (dependency-base booting) – hhlp Aug 13 '11 at 9:28

In your /etc/init/ssh.conf, comment out the start on line:

# ssh - OpenBSD Secure Shell server
# The OpenSSH server provides secure shell access to the system.

description     "OpenSSH server"

#start on filesystem or runlevel [2345]
stop on runlevel [!2345]

respawn limit 10 5
umask 022
share|improve this answer
I'm of the opinion that in general it's better to use the more generic mechanisms that @komputes and hhlp mention. Though this is fine for a single case. – belacqua Jun 19 '12 at 17:25
sudo apt-get install bum

Start bum with administrative privileges, disable openssh-server, confirm it, done.

share|improve this answer

For versions with ssh started by upstart, run touch /etc/ssh/sshd_not_to_be_run. The upstart init script checks for this file and, if existent, does not start sshd.

share|improve this answer

The manual method provided /etc/init/ssh.config.override method does not work for me using Ubuntu 14.04.03. sshd still starts automatically.

The /etc/ssh/sshd_not_to_be_run method prevents manual sshd start.

I had to use Brian Agee's method of removing the "start on" on line of /etc/init/ssh.conf. Then to manually start sshd:

sudo service ssh start
share|improve this answer

Your Answer


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.