0

I want to remove unnecessary services in Ubuntu server 13.04 for hardening purpose. I don't know use which blow command for dedicate services: 1. inintct list 2. sysv-rc-conf list 3. ls /etc/init.d 4. service --status-all

why outputs of each above command are different? I tried stop atd service with "service atd stop", but after reboot system this service start again. Since I want hardening my server, how to disable a service permanently? and which services should be disable?

Thanks.

3 Answers 3

1

/etc/init.d holds the start up/shut down scripts for various services, but they are actually invoked by the scripts in /etc/rc*.d.

The rc*.d scripts are actually hold symbolic links to /etc/init.d scripts, and the names in the rc*.d directories say whether to start or stop a service as you enter that run level - the number in the name gives the order in which to run the scripts.

So, for example, /etc/rc3.d/S23ntp says to start the ntp daemon at run level 3 (after all the lower numbered services have been started).

So - to stop a service running after a reboot, the best thing to do is manipulate the rc*.d scripts.

And the best way to do that is to use the update-rc.d command. e.g. to disable ntp at boot, run:

update-rc.d ntp disable

As to what services to disable - be careful that you understand what a service does and its purpose before disabling it.

I was going to give atd as an example - this is a process that uses very little resource, but stopping it may have unintended consequences.

But as it turns out, atd is actually invoked by a different mechanism (upstart) - and I don't have time to go in to that now!

1

I do not recommend you to disable services you don't know of, to disable services that ship with the system you have to have deeper knowledge of the system. You could likely end up with a broken system.

Since it seems you do not know about SysV-init scripts or Upstart jobs, i would suggest you get in touch with them first.

Take a look at this tutorial.

0

You can manage services on startup with rcconf:

sudo apt-get install rcconf

Then, start it:

sudo rcconf

And uncheck the ones you don't want loaded automatically on startup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .