Good Morning, it's Thu 21 Nov 2024
create or edit /etc/pam_smb.conf
(where [DOMAIN] is you Active Directory Domain and [DC1] and [DC2} are 2 domain
controllers.)
# pam_smb.conf
[DOMAIN]
[DC1]
[DC2}
# /etc/nsswitch.conf
#
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis
passwd: files winbind db nisplus
shadow: files winbind db nisplus
group: files winbind db nisplus
#%PAM-1.0
auth required /lib/security/pam_winbind.so
auth required /lib/security/pam_stack.so service=system-auth
account required /lib/security/pam_winbind.so
account required /lib/security/pam_stack.so service=system-auth
password required /lib/security/pam_winbind.so
#%PAM-1.0
auth required /lib/security/pam_securetty.so
auth sufficient /lib/security/pam_winbind.so
auth sufficient /lib/security/pam_unix.so use_first_pass
auth required /lib/security/pam_stack.so service=system-auth
auth required /lib/security/pam_nologin.so
account sufficient /lib/security/pam_winbind.so
account required /lib/security/pam_stack.so service=system-auth
password required /lib/security/pam_stack.so service=system-auth
session required /lib/security/pam_stack.so service=system-auth
session optional /lib/security/pam_console.so
#%PAM-1.0
#auth required /lib/security/pam_stack.so service=system-auth
auth sufficient /lib/security/pam_winbind.so
auth sufficient /lib/security/pam_unix.so use_first_pass
auth required /lib/security/pam_stack.so service=system-auth
auth required /lib/security/pam_nologin.so
account sufficient /lib/security/pam_winbind.so
account required /lib/security/pam_stack.so service=system-auth
password required /lib/security/pam_stack.so service=system-auth
session required /lib/security/pam_stack.so service=system-auth
session required /lib/security/pam_limits.so
session optional /lib/security/pam_console.so
## Winbind
##
# specify the uid range which can be used by winbindd
# to allocate uids for Windows users as necessary
winbind uid = 10000-65000
# specify the uid range which can be used by winbindd
# to allocate uids for Windows users as necessary
winbind gid = 10000-65000
# Define a home directory to be given to passwd(5) style entries
# generated by libnss_winbind.so. You can use variables here
template homedir = /home/%D/%U
# Specify a shell for all winbind user entries return by the
# libnss_winbind.so library.
template shell = /bin/bash
# What character should be used to separate the DOMAIN and Username
# for a Windows user. The default is DOMAIN\user, but many people
# prefer DOMAIN+user
winbind separator = +
winbind enum users = yes
winbind enum groups = yes
[Files]
available = yes
browseable = yes
path = /home/samba/files
public = yes
writable = yes
valid users = nobody DOMAIN+User1 DOMAIN+User2 DOMAIN+User3 localuser
create mask = 764
inherit permissions = yes
[Websites]
available = yes
browseable = yes
path = /home/samba/websites
public = yes
writable = yes
valid users = nobody DOMAIN+User1 DOMAIN+User2 DOMAIN+User3 DOMAIN+User4 localuser
force user = nobody
force group = nobody
create mask = 755
inherit permissions = yes
smbpasswd -j DOMAIN -r DC1 -U Administrator
The proper response to the command should be: "Joined the domain DOMAIN"
where DOMAIN is your DOMAIN name.
Start the winbindd daemon and try wbinfo -u to verify it's working