2

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 chdir() into /home/$USER.

The workaround I'm currently using is symlinking /home/$DOMAIN to /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.

  • It works for me with Debian/testing ("stretch"), using sssd:amd64/testing 1.13.4-2. So we just need to find the difference. Let's start with adding fallback_homedir = /home/%d/%u to your [domain] section in /etc/sssd/sssd.conf, restart sssd and see what happens. – roaima Jun 20 '16 at 19:34
  • The other part of this is to check for any value of override_dir and fallback_dir that may be already present – roaima Jun 20 '16 at 20:02
0

Highly unlikely that systemd is at fault here. Logind does nothing related to home directories (it deals with handing out permissions to access local hardware for local logins, and not doing so for remote logins -- so that people who log in through SSH can't peek at your webcam).

Instead, It's much more likely you didn't do everything right.

Please show the contents of your PAM config files after you've run the script. Most likely, you missed a bit.

Try disabling nscd, to make sure that it's not a caching issue.

Check your /etc/skel; make sure it doesn't contain a hardcoded reference to /home/$USER.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.