Configuring Samba on the server hosting the Squid service
July 3, 2024
ID 166650
To configure the Samba service:
- Start the Samba services and add them to autostart. To do so, run the following commands depending on the utilized operating system:
- CentOS, Red Hat Enterprise Linux or SUSE Linux Enterprise Server:
systemctl start smb
systemctl enable smb
systemctl start nmb
systemctl enable nmb
- Ubuntu or Debian:
systemctl start smbd
systemctl enable smbd
systemctl start nmbd
systemctl enable nmbd
- CentOS, Red Hat Enterprise Linux or SUSE Linux Enterprise Server:
- Add the following parameters to the /etc/samba/smb.conf file:
[global]
workgroup = <NetBIOS name of the Active Directory domain>
password server = <DNS name of the Active Directory domain controller>
realm = <uppercase Active Directory domain name>
security = ads
idmap uid = 10000-20000
idmap gid = 10000-20000
winbind use default domain = no
winbind request timeout = 300
- Add the server hosting the Squid service to the Active Directory domain. To do so, execute the command:
net ads join -U <domain administrator>
You will be prompted to enter the password of the domain administrator or the password of a user with domain administrator rights.
- Type the administrator password and press ENTER.
The server hosting the Squid service should be added to the Active Directory domain.
- Make sure that the server hosting the Squid service was actually added to the Active Directory domain. To do so, execute the command:
net ads testjoin
If the server hosting the Squid service was added to the Active Directory domain,
Join is OK
is displayed in the console. - Restart the Samba services. To do so, run the following commands depending on the utilized operating system:
- CentOS, Red Hat Enterprise Linux or SUSE Linux Enterprise Server.
systemctl restart smb
systemctl restart nmb
- Ubuntu or Debian.
systemctl restart smbd
systemctl restart nmbd
If you see "ERROR: failed to setup guest info", you must configure mapping for the guest group. To do so, run the command
net groupmap add sid=S-1-5-32-546 unixgroup=nobody type=builtin
- CentOS, Red Hat Enterprise Linux or SUSE Linux Enterprise Server.
- Start the winbind service. To do so, execute the command:
systemctl start winbind
- Add the winbind service to autostart. To do so, execute the command:
systemctl enable winbind
- If you use Ubuntu or Debian, add the 'proxy' user to the 'winbindd_priv' group. To do so, execute the command:
usermod -a -G winbindd_priv proxy
Samba configuration will be completed. Proceed to check the Samba settings.