EDIT #1 - Ubuntu update:
I ended up getting this to work for CentOS, RedHat, and Ubuntu. Ubuntu is similar but has some differences in package names and making the homedir.
Using samba, winbind, and net ads join:
dnf install samba samba-client samba-winbind samba-winbind-clients oddjob oddjob-mkhomedir
/etc/samba/smb.conf:
[global]
workgroup = DEV
realm = DEV.DOMAIN.COM
security = ads
idmap config * : backend = autorid
idmap config * : range = 100000-19999999
idmap config * : rangesize = 1000000
template homedir = /home/%D/%U
template shell = /bin/bash
winbind use default domain = false
winbind offline logon = true
log file = /var/log/samba/log.%m
max log size = 50
log level = 0
Join and stop/start winbind:
systemctl stop winbind
net ads join -U domainAdmin
systemctl enable winbind --now
Now I can ssh as a corp user to a dev machine but I have to specify the corp domain at login otherwise it defaults to local user and fails:
ssh -l [email protected] 10.1.100.100
[CORP\username@hostnametest ~]$ whoami
CORP\username
[CORP\username@hostnametest ~]$ pwd
/home/CORP/username
Is there a way to just default add the corp domain for login attempts or ideally, another samba or ssh config setting that handles it?
EDIT #1:
Ubuntu is pretty much the same
apt -y install winbind libpam-winbind libnss-winbind krb5-config samba-dsdb-modules samba-vfs-modules
Same smb.conf
Additionally, I added these edits in /etc/nsswitch.conf and /etc/pam.d/common-session
/etc/nsswitch.conf:
passwd: files systemd winbind
group: files systemd winbind
/etc/pam.d/common-session:
session optional pam_mkhomedir.so skel=/etc/skel umask=077
Join and restart winbind.
I didn't have to update DNS settings in netplan because it already had the right nameservers.