The main idea is that /export/home is for local users, and is physically located on your computer, while /home is managed by autofs and has mounted user directories that are shared with NFS.
What's probably most suitable for you:
- Make a new user and create his home directory in /export/home:
useradd -d /export/home/testuser -m testuser
- Change it's home directory to /home:
usermod -d /home/testuser testuser
- Put a new line it /etc/auto_home like this one:
testuser localhost:/export/home/&
which says to mount a directory of user testuser that is located on the NFS server called localhost and is located in the /export/home/& directory. Ampersand is a variable that will be have value testuser in this case.
This way you can also add user home directories from remote NFS shares.
Note: you don't need NFS server running on your machine for this example to work, because local directories are mounted directly bypassing the NFS protocol.
Attention! Home directory of a certain user will be automounted only when this user logs in.
No comments:
Post a Comment