I am using Ubuntu 10.04 and have installed openssh-server.

How do I disable/enable it from being started at boot time?

Apparently it is not done with chkconfig

# chkconfig --list|grep -i ssh
ssh                       0:off  1:off  2:off  3:off  4:off  5:off  6:off

This should be enough, even if you're using upstart (dependency-base booting):

update-rc.d ssh enable # sets the default runlevels to on
update-rc.d ssh disable # sets all to off

I didn't know Ubuntu included chkconfig by default, that's pretty interesting - Debian doesn't.

See the comment below on how to remove startup links - I'm not sure that works when using upstart though.

  • and update-rc.d -f ssh remove – 3molo May 6 '11 at 10:50
  • Sorry, I forgot about removal. Are you sure this still works with upstart? – Eduardo Ivanec May 6 '11 at 10:54
  • This disables the startup but if there is a current instance running, you still have to service sshd stop or your local equivalent. (I'm on Debian here.) – tripleee Jan 27 '17 at 8:27

There is not command I know of that can disable upstart jobs, but you can manually disable services by editing the corresponding Upstart configuration files. To stop SSHd from starting at boot time, comment out the line start on ... in /etc/init/ssh.conf as in:

description     "OpenSSH server"

#start on filesystem
stop on runlevel [!2345]

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.