3

Possible Duplicate:
How do I disable SSH from starting automatically?

Simple question here; what's the correct way to stop the sshd service from starting when the OS boots ? I'm not sure if this answer is correct, so I'm hoping some guru(s) can help me out!

What I'd like is a configuration that (after boot) allows me to start the service using sudo service ssh start when necessary.

Version info:

me@home:~$ ssh -V
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
me@home:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:    12.04
Codename:   precise
blong
  • 204
  • 2
  • 5
  • 16
  • 1
    Useful answers at http://askubuntu.com/questions/19320/how-to-enable-or-disable-services – here Jan 02 '15 at 09:49

2 Answers2

4

Remove the service from startup with:

sudo update-rc.d -f sshd remove

Reset it with:

sudo update-rc.d sshd defaults
wojox
  • 11,152
  • 5
  • 40
  • 60
  • I'm not exactly sure what you mean by remove and reset... Will I still be able to start the service manually? (i.e. with `sudo service ssh start` ) ? – blong Oct 10 '12 at 02:12
  • Yes, look more into services, runlevels, and rc.d scripts. – wojox Oct 10 '12 at 12:34
  • 1
    It looks like this isn't exactly the solution I'm looking for: `me@home-computer:~$ sudo update-rc.d -f sshd remove` `Removing any system startup links for /etc/init.d/sshd ...` `me@home-computer:~$ sudo reboot` When my computer restarted, I was able to ssh to localhost without starting the service: `me@home-computer:~$ ssh me@localhost` `me@localhost's password: ***` `Welcome to Ubuntu 12.04...` I'm looking for a way to simply stop the service from starting automatically. Any other thoughts? – blong Oct 16 '12 at 02:35
  • Did you try the answer you posted in your question? That is another option. Probably a good one. – wojox Oct 16 '12 at 03:07
  • 1
    I didn't post an answer in my question, not sure what you mean? – blong Oct 17 '12 at 00:45
  • 1
    This does not work on ubuntu 14.04. See `upstart` and `/etc/init/ssh.conf` [how-to-enable-or-disable-services](http://askubuntu.com/questions/19320/how-to-enable-or-disable-services) – here Jan 02 '15 at 09:50
1

You could install Boot-Up Manager. It is a GUI to enable or disable services on startup.

sudo apt-get install bum

It has to be run as root user.

sudo bum

enter image description here

abhshkdz
  • 3,909
  • 2
  • 19
  • 15