I'm forced (ugh) to join several linux machines to a domain. I'm currently using debian stable, and am joining the machines using a join script I wrote (at https://rbmj.github.io/join.sh for reference). The setup uses realm and sssd for all of the joining magic, and pam_mkhomedir to create home directories. Machines are debian stable.
getent passwd $USER shows proper uid/gid and home directory set to
/home/$DOMAIN/$USER as it should be.
The problem is that on logon pam_mkhomedir.so is creating the home directory in the proper place (
/home/$DOMAIN/$USER), but login tries to
The workaround I'm currently using is symlinking
/home, which is an ugly symlink loop, but it gets the job done for now. Once I can figure this out migration should be fairly straightforward, as there's only one or two system accounts so I can move the rest via script.
Since this is a recently installed debian stable machine, I think it's a systemd issue, as I believe the standard login daemon is replaced by systemd-logind or similar cruft. I think this is a bug somewhere, as login should try to change directory to whatever nsswitch indicates is the user's proper home directory, but I'm no expert.