On a Ubuntu server with a SAMBA share, I am trying to allow access from some IP addresses and deny from others.
smb.conf as follows:
[global] server string = %h server (Samba, Ubuntu) server role = standalone server map to guest = Bad User obey pam restrictions = Yes pam password change = Yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . unix password sync = Yes syslog = 0 log file = /var/log/samba/log.%m max log size = 1000 dns proxy = No usershare allow guests = Yes panic action = /usr/share/samba/panic-action %d idmap config * : backend = tdb hosts allow = 10.4. 10.162. localhost hosts deny = 10.4.114.125 [printers] comment = All Printers path = /var/spool/samba create mask = 0700 printable = Yes browseable = No [print$] comment = Printer Drivers path = /var/lib/samba/printers [data] comment = Data Folder path = /data force user = devuser force group = devgroup group = devgroup read only = No create mask = 0660 force create mode = 0664 directory mask = 0774 directory mode = 0774 force directory mode = 0774 guest ok = Yes
Then I reload the config by running
sudo smbcontrol all reload-config.
Unfortunately I cannot restart the samba service because others are using it heavily.
After reloading the config, I can still access the share from my computer (10.4.114.125) although explicitely denied. I tried rebooting my computer and it didn't change. Any ideas?
EDIT: If I set the deny list not in the global section but the share specifically it seems to work.