Article 51RFJ Mounting remote share via fstab as home directory for a user???

Mounting remote share via fstab as home directory for a user???

by
penyuan
from LinuxQuestions.org on (#51RFJ)
Dear LinuxQuestions.org,

As part of my learning process, I've been thinking about experimenting with using fstab-mounted network shares as home directories for users. For example, let's say I have a user `hsimpson` on a CentOS 8 system. Instead of using local `/home/hsimpson` as that user's home directory, I add this line to my `/etc/fstab` file:

Code:\\remote\share /home/hsimpson cifs user,uid=123,rw,suid,username=foo,password=bar 0 0Where `uid=123` is user `hsimpson`'s UID in the local system. (I know I can additionally use a credentials file instead of putting the remote username and password in fstab) Is this all that's needed to make the home directory on a remote share?

If I want to do this, what should I do when first creating the user `hsimpson` with `useradd`? How do I correctly specify this home directory? Any gotchas? Do I set up fstab first, then create the user while specifying the fstab mountpoint as the home directory?

Also, would this incur permissions (or even SELinux?!?!?!) problems for `hsimpson`?

Thank you!latest?d=yIl2AUoC8zA latest?i=FL8hjyyGrk0:Ritljsw7CUk:F7zBnMy latest?i=FL8hjyyGrk0:Ritljsw7CUk:V_sGLiP latest?d=qj6IDK7rITs latest?i=FL8hjyyGrk0:Ritljsw7CUk:gIN9vFwFL8hjyyGrk0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments