sudo -i
apt install sssd heimdal-clients msktutil
[libdefaults] default_realm = CONTOSO.COM [realms] CONTOSO.COM = { kdc = DC admin_server = dc.contoso.com default_domain = contoso.com } [login] krb4_convert = true krb4_get_tickets = false [domain_realm] .contoso.com = CONTOSO.COM contoso.com = CONTOSO.COM
127.0.0.1 localhost 127.0.1.1 <hostname>.contoso.com <hostname>
root@ubuntu:~# kinit YourDomainAdmin YourDomainAdmin@CONTOSO.COM's Password:
root@ubuntu:~# klist Credentials cache: FILE:/tmp/krb5cc_0 Principal: YourDomainAdmin@CONTOSO.COM Issued Expires Principal Dec 1 15:08:27 2018 Dec 2 01:08:22 2018 krbtgt/CONTOSO.COM@CONTOSO.COM
msktutil -c -b 'CN=YourComputersOU' -s HOST/HOSTNAME.contoso.com -k /etc/sssd/HOSTNAME.keytab --computer-name HOSTNAME --upn HOSTNAME$ --server dc.contoso.com —user-creds-only msktutil -c -b 'CN=YourComputersOU' -s HOST/HOSTNAME -k /etc/sssd/HOSTNAME.keytab --computer-name HOSTNAME --upn HOSTNAME$ --server dc.contoso.com --user-creds-only
kdestroy
[sssd] services = nss, pam config_file_version = 2 domains = contoso.com [nss] entry_negative_timeout = 0 debug_level = 3 [pam] debug_level = 3 [domain/contoso.com] debug_level = 3 ad_domain = contoso.com ad_server = dc.contoso.com enumerate = false id_provider = ad auth_provider = ad chpass_provider = ad access_provider = simple simple_allow_groups = users #каким группам разрешено логиниться, через запятую. Есть ограничение — названия групп должны быть с маленькой буквы. ldap_schema = ad ldap_id_mapping = true fallback_homedir = /home/%u default_shell = /bin/bash ldap_sasl_mech = gssapi ldap_sasl_authid = <HOSTNAME>$ ldap_krb5_init_creds = true krb5_keytab = /etc/sssd/<HOSTNAME>.keytab
chmod 600 /etc/sssd/sssd.conf
service sssd restart
session required pam_unix.so
session required pam_mkhomedir.so skel=/etc/skel umask=0022
pam-auth-update
visudo -f /etc/sudoers.d/ваш_файл
%Domain\ Admins ALL=(ALL) ALL
Source: https://habr.com/ru/post/437546/