12

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*
17

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
  • 1
    Yes, but it works only till reboot. I need to disable Samba service. In Ubuntu 10 there was link in rc2.d S20samba -> ../init.d/samba – user184596 Aug 16 '13 at 11:26
  • 2
    Try this sudo update-rc.d -f smbd remove – Tarun Aug 16 '13 at 11:27
  • Wasn't Samba converted to Upstart job or something? – moon.musick Aug 16 '13 at 11:47
  • I'm on ubuntu 16.04 and there is no smbd anywhere... – Alexis Wilke Feb 12 '18 at 5:33
2

Use this command to disable the Samba service:

update-rc.d -f smbd defaults 

Or use this for the Upstart service:

echo 'manual' | sudo tee /etc/init/smbd.conf

Or you can install and check for services:

apt-get install rcconf

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.