Currently, I have a fleet of linux computers joined to an active directory domain with SSSD for user management - primarily ubuntu, with some Raspian as well.
I'm using pam_mkhomedir.so to create home directories locally for any domain login, via /etc/pam.d/common-session.
session required pam_mkhomedir.so skel=/etc/skel/ umask=0077 This works great for local console login, as well as su [domainuser]. It creates the directory in /home/[domain]/[user]. However, when the user's first login is via SSH (which is usually the case for servers), it causes the directory to be owned by root:root, instead of the correct user.
I've been tearing my hair out with this one, trying anything I can find. Any ideas?
/etc/pam.d/sshdcontain either@include common-sessionOR the abovepam_mkhomdirline? (BTW, I haven't used pam_mkhomedir for years but when I did, it worked flawlessly for any kind of logon, including console, ssh, and samba - in fact, most users only ever connected via samba)