Ubuntu – How to disable Samba on Ubuntu 12.04

12.04samba

I need to disable (not uninstall) Samba on Ubuntu 12.04 server but I cant see any link in rc2.d directory. How Samba is starting after reboot? How to disable smbd/nmbd daemon?? What is winbind?

root@newnagios:~# ll /etc/rc2.d/
total 12
drwxr-xr-x   2 root root 4096 Aug 15 16:23 ./
drwxr-xr-x 101 root root 4096 Aug 16 12:13 ../
-rw-r--r--   1 root root  677 Jul 26  2012 README
lrwxrwxrwx   1 root root   17 Aug  4 20:34 S20postfix -> ../init.d/postfix*
lrwxrwxrwx   1 root root   15 Aug 12 15:55 S20snmpd -> ../init.d/snmpd*
lrwxrwxrwx   1 root root   17 Aug  4 20:34 S20winbind -> ../init.d/winbind*
lrwxrwxrwx   1 root root   13 Aug  5 12:42 S23ntp -> ../init.d/ntp*
lrwxrwxrwx   1 root root   15 Aug  4 18:07 S25mdadm -> ../init.d/mdadm*
lrwxrwxrwx   1 root root   15 Aug  4 20:34 S50rsync -> ../init.d/rsync*
lrwxrwxrwx   1 root root   19 Aug  4 20:34 S70dns-clean -> ../init.d/dns-clean*
lrwxrwxrwx   1 root root   18 Aug  4 20:34 S70pppd-dns -> ../init.d/pppd-dns*
lrwxrwxrwx   1 root root   14 Aug  4 22:03 S75sudo -> ../init.d/sudo*
lrwxrwxrwx   1 root root   17 Aug  4 20:34 S91apache2 -> ../init.d/apache2*
lrwxrwxrwx   1 root root   21 Aug  4 20:35 S99grub-common -> ../init.d/grub-common*
lrwxrwxrwx   1 root root   18 Aug  4 18:06 S99ondemand -> ../init.d/ondemand*
lrwxrwxrwx   1 root root   18 Aug  4 18:06 S99rc.local -> ../init.d/rc.local*

Best Answer

Type the following command to stop smbd service.

To Stop Samba:

sudo service smbd stop

or

sudo /etc/init.d/smbd stop

To Start Samba:

sudo service smbd start

or

sudo /etc/init.d/smbd start

To remove it from rc.d file use the command

sudo update-rc.d -f smbd remove

To restore it to rc.d use the command

sudo update-rc.d smbd defaults
Related Question