Tuesday, November 8, 2011

Disabling the unnecessary services in ubuntu or debian

Sponsored Links

We can list all the services currently running using the following command. 
#service --status-all


Eg:
root@host ~ # service --status-all
 [ ? ]  amavis
 [ + ]  apache2
 [ + ]  apparmor
 [ ? ]  atd
 [ + ]  bind9
 [ - ]  bootlogd
 [ - ]  clamav-daemon
 [ + ]  clamav-freshclam
 [ ? ]  console-setup
***********out put truncated********


To remove a service from debian startup execute the following command
#update-rc.d -f  service_name remove

Eg:

root@host ~ # update-rc.d -f atd remove
 Removing any system startup links for /etc/init.d/atd ...
root@host ~ #


In case if you want to add a service to ubuntu default runlevels execute the following command. 
#update-rc.d service_name defaults

Eg:

root@host ~ # update-rc.d proftpd defaults
 Adding system startup for /etc/init.d/proftpd ...
   /etc/rc0.d/K20proftpd -> ../init.d/proftpd
   /etc/rc1.d/K20proftpd -> ../init.d/proftpd
   /etc/rc6.d/K20proftpd -> ../init.d/proftpd
   /etc/rc2.d/S20proftpd -> ../init.d/proftpd
   /etc/rc3.d/S20proftpd -> ../init.d/proftpd
   /etc/rc4.d/S20proftpd -> ../init.d/proftpd
   /etc/rc5.d/S20proftpd -> ../init.d/proftpd
root@host ~ #

Sponsored Links

No comments:

Post a Comment

Be nice. That's all.