Letās try to get all the necessary things straight. This is [WIP] so add whatever you think needs to be added:
Checks
We need to check if the Domain Controller is accessible from the client.
>dig -t SRV _ldap._tcp.subdomain.domain.tld
If you donāt have a subdomain configured, you should leave out the subdomain part. The response you should get is something like this:
> beheer@E540:~$ dig -t SRV _ldap._tcp.interlin.lan
> ; <<>> DiG 9.10.3-P4-Ubuntu <<>> -t SRV _ldap._tcp.interlin.lan
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26802
> ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
> ;; QUESTION SECTION:
> ;_ldap._tcp.interlin.lan. IN SRV
> ;; ANSWER SECTION:
> _ldap._tcp.interlin.lan. 900 IN SRV 0 100 389 nsdc-hs001.interlin.lan.
> ;; AUTHORITY SECTION:
> interlin.lan. 3600 IN SOA nsdc-hs001.interlin.lan. hostmaster.interlin.lan. 1 900 600 86400 3600
> ;; Query time: 15 msec
> ;; SERVER: 127.0.1.1#53(127.0.1.1)
> ;; WHEN: Tue Jan 24 09:14:13 CET 2017
> ;; MSG SIZE rcvd: 119
In the Answer section you will find the Domain Controller(s) of your domain. For NethServer this is the NSDC container for Samba4 AD.
Check if you can reach the Domain Controller from your client: ping YourDC.subdomain.domain.tld
In my case: ping nsdc-hs001.interlin,lan
Install packages on client
sudo apt-get -y install realmd sssd sssd-tools samba-common krb5-user packagekit samba-common-bin samba-libs adcli ntp
You will be prompted to give the kerberos realm. Note kerberos realms are ALWAYS in CAPITALS
Settings
/etc/hosts
I created DHCP reservation for my client in NethServer DHCP and added the client to the local hosts file too. In my case the FQDN of NethServer is hs001.interlin.lan
The NSDC container FQDN is generated during install of Samba4 AD module and based on the NS7 FQDN. Both NS7 and the NSDC container have fixed IP addresses
Added entries in /etc/hosts:
192.168.10.99 E540.interlin.lan
192.168.10.5 hs001.interlin.lan
192.168.10.6 nsdc-hs001.interlin.lan
/etc/ntp.conf
Timestamps are very important for Kerberos tickets. So you must sync your client with the NSDC ntp server. On the client I commented out external ntp servers and added the NSDC ntp server.
Add the entry:
server nsdc-hs001.interlin.lan
/etc/realmd.conf
Note: adapt os-name and os-version to your situation.
[users]
default-home = /home/%D/%U
default-shell = /bin/bash
[active-directory]
default-client = sssd
os-name = Ubuntu Desktop Linux
os-version = 16.04
[service]
automatic-install = no
[interlin.lan]
fully-qualified-names = no
automatic-id-mapping = yes
user-principal = yes
manage-system = no
Join the client to the AD domain
sudo kinit administrator@SUBDOMAIN.DOMAIN.TLD
(ommit SUBDOMAIN if you donāt have that configured)
The user you use must be a member of domain admins. The administrator account must be given een password to activate it in NethServer.
/etc/krb5.conf
With @Ctek I discussed what should go here. There might be some settings overdone. Needs testing what can be left out. Note: kerberos realm must be in UPPERCASE:
[libdefaults]
default_realm = INTERLIN.LAN
[realms]
INTERLIN.LAN = {
kdc = NSDC-HS001.INTERLIN.LAN
master_kdc = NSDC-HS001.INTERLIN.LAN
admin_server = NSDC-HS001.INTERLIN.LAN
}
[domain_realm]
.interlin.lan = INTERLIN.LAN
interlin.lan = INTERLIN.LAN
/etc/sssd/sssd.conf
I have the following lines in sssd.conf. Unsure what the last line (for my domain username) is doing.
[sssd]
domains = interlin.lan
config_file_version = 2
services = nss, pam
[domain/interlin.lan]
ad_domain = interlin.lan
krb5_realm = INTERLIN.LAN
realmd_tags = manages-system joined-with-adcli
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
default_shell = /bin/bash
ldap_id_mapping = True
use_fully_qualified_names = True
fallback_homedir = /home/%u@%d
access_provider = ad
simple_allow_users = rob
/etc/pam.d/common-session
AS far as I know this is quite default. the modules to load are:
session required pam_unix.so
session optional pam_sss.so
session optional pam_systemd.so
session required pam_mkhomedir.so skel=/etc/skel/ umask=0077
# end of pam-auth-update config
/etc/lightdm/lightdm.conf (on an Ubuntu client with Unity Desktop Manager, settings for Gnome/KDE/Cinnamon etc???)
For Ubuntu 16.04 the lightdm.conf is located on a different location. You have to look for: /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf. manual login is active since you want to be able to log in with a domain account. First login you will need to use account@domain.tld as username to log in.
[Seat:*]
greeter-session=unity-greeter
greeter-show-manual-login=true
allow-guest=false
Check for errors in:
-
/var/log/auth.log
-
/var/log/syslog
-
/var/log/sssd/*