Three ways to join debian 10 to active directory
Set your network dns to your domain controler
Time sync
# PATH Debian 10 error
# Possible error
locale: Cannot set LC_ALL to default locale: No such file or directory
* Corect with
dpkg-reconfigure locales
1º Realmd + SSSD
realm discover my.local
realm join -U Administrator my.local
realm list
Edit sssd config
use_fully_qualified_names = False
Edit pam config
Name: Create home directory on login
Default: yes
Priority: 900
session-type: additional
#Session-Interactive-Only: yes
session:
required pam_mkhomedir.so skel=/etc/skel umask=0077
pam update
Set group permissions
realm deny --all
realm permit -g usergroup
Add domain admins as sudoers
%usergroup ALL=(ALL) ALL
reboot
Enjoy
2º Realmd + winbind
cat << EOF > /etc/realmd.conf
[users]
default-home = /home/%U
default-shell = /bin/bash
[active-directory]
# default-client = sssd
default-client = winbind
EOF
mv /etc/krb5.conf /etc/krb5.conf.bkp
cat << EOF > /etc/krb5.conf
[libdefaults]
default_realm = MY.LOCAL
dns_lookup_realm = false
dns_lookup_kdc = true
EOF
realm join -U administrator my.local
Edit pam config
Name: Create home directory on login
Default: yes
Priority: 900
session-type: additional
#Session-Interactive-Only: yes
session:
required pam_mkhomedir.so skel=/etc/skel umask=0077
pam update
systemctl restart smbd nmbd winbind
* If winbind does not start, you may need to change "security = ads" to "security = user" restart winbind, change back and restart smbd nmbd
wbinfo -u (check users)
wbinfo -g (check groups)
Add domain admins as sudoers
%usergroup ALL=(ALL) ALL
reboot
Enjoy
3º net ads join + winbind
mv /etc/krb5.conf /etc/krb5.conf.bkp
cat << EOF > /etc/krb5.conf
[libdefaults]
default_realm = MY.LOCAL
dns_lookup_realm = false
dns_lookup_kdc = true
EOF
mv /etc/samba/smb.conf /etc/samba/smb.conf.bkp
cat << EOF > /etc/samba/smb.conf
[global]
workgroup = MY
security = ads
realm = MY.LOCAL
vfs objects = acl_xattr
map acl inherit = Yes
store dos attributes = Yes
winbind enum users = yes
winbind enum groups = yes
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
dedicated keytab file = /etc/krb5.keytab
kerberos method = secrets and keytab
idmap config * : backend = tdb
idmap config * : range = 3000-7999
idmap config MY:backend = autorid
idmap config MY:schema_mode = rfc2307
idmap config MY:unix_nss_info = yes
idmap config MY:range = 8000-999999
idmap config MY:unix_primary_group = yes
template shell = /bin/bash
template homedir = /home/%U
winbind use default domain = yes
EOF
net ads join -U administrator
Edit pam config
Name: Create home directory on login
Default: yes
Priority: 900
session-type: additional
#Session-Interactive-Only: yes
session:
required pam_mkhomedir.so skel=/etc/skel umask=0077
pam update
systemctl restart smbd nmbd winbind
* If winbind does not start, you may need to change "security = ads" to "security = user" restart winbind, change back and restart smbd nmbd
wbinfo -u (check users)
wbinfo -g (check groups)
Add domain admins as sudoers
%usergroup ALL=(ALL) ALL
reboot
Enjoy
IMPORTANT NOTICE: Image by studiogstock on Freepik