I use ubuntu 14.10 and I want to stop the SSH service from auto startup. Will it be enough to change the start up script to be /etc/rc2.d/K03ssh or I should do sudo update-rc.d -f ssh remove also

  • Please edit your question to include the Ubuntu version. – JdeBP May 10 '15 at 7:01
  • i use ubuntu version14.10 – Fat Mind May 10 '15 at 7:47

Yes and no. As explained in /etc/rc2.d/README, to disable a service in that runlevel you can rename as you suggest but should also run update-rc.d script defaults to reorder the scripts:

To disable a service in this runlevel, rename its script in this directory so that the new name begins with a 'K' and a two-digit number, and run 'update-rc.d script defaults' to reorder the scripts according to dependencies. A warning about the current runlevels being enabled not matching the LSB header in the init.d script will be printed. To re-enable the service, rename the script back to its original name beginning with 'S' and run update-rc.d again.

However, it is much simpler and safer to use the tools provided. Instead of removing the ssh service, use update-rc.d to disable it on runlevel 2:

sudo  update-rc.d -f ssh disable 2
| improve this answer | |

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.