如何在Ubuntu 12.04上禁用Samba?


12

我需要在Ubuntu 12.04服务器上禁用(而不是卸载)Samba,但是在rc2.d目录中看不到任何链接。重新启动后Samba如何启动?如何禁用smbd / nmbd守护程序?什么是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*

Answers:


17

键入以下命令以停止smbd服务。

要停止Samba:

sudo service smbd stop

要么

sudo /etc/init.d/smbd stop

要启动Samba:

sudo service smbd start

要么

sudo /etc/init.d/smbd start

要将其从rc.d文件中删除,请使用以下命令

sudo update-rc.d -f smbd remove

要将其还原到rc.d,请使用以下命令

sudo update-rc.d smbd defaults

1
是的,但仅在重新启动之前有效。我需要禁用Samba服务。在Ubuntu 10中,rc2.d中存在链接S20samba -> ../init.d/samba
2013年

2
试试这个sudo update-rc.d -f smbd remove
Tarun

Samba不会转换为Upstart作业吗?
moon.musick

我正在使用Ubuntu 16.04,那里什么smbd都没有...
Alexis Wilke

2

使用以下命令禁用Samba服务:

update-rc.d -f smbd defaults 

或将此用于Upstart服务:

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

或者,您可以安装并检查服务:

apt-get install rcconf
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.