Score:0

How to set up remote home folders on Ubuntu 22.04 using CIFS

pe flag

I'm trying to set up remote home folders for Ubuntu 22.04 workstations. These workstations are joined to an AD domain using sssd and krb5, and users sign in using their AD credentials. I'm also using pam_mount to mount some CIFS/SMB shares using the krb5 credentials. That's all good and working.

I'd now like to host users home folders remotely, so that they can log in on different workstations and still have their settings and user data available. For that I'd like to auto-mount the /home/username folder to a CIFS/SMB share //server/homes/username on login using the users krb5 ticket.

I've tried setting this up with either pam_mount or autofs, but have not managed to get this working reliably. If someone could point me into the right direction there that would be much appreciated.


Edit 05 Feb 2023:

The thing that almost works is:

  • mount folder /mnt/home to //server/homes with autofs
  • add the following to sssd.conf: override_homedir = /mnt/home/%u

This is slightly different to my initial attempt to mount /home/username... and works sometimes. But there is some sort of race condition, where at the time Ubuntu checks for the homedir the mount may or may not exist yet. Result is that things either work, or you get an error msg saying "could not chdir to home directory... no such file or directory"

cqcallaw avatar
jp flag
The Kerberos credentials cache path for the network users will need to be adjusted here. Default credentials cache path is `/home/<user>/krb5cc_<uid>` which will not contain an up-to-date TGT if that location is mounted to a CIFS share.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.