31 March 2011

Home Philosophy in Sun/Oracle Solaris

If you've had some experience with Solaris you probably know, that there is something different with users home comparing to the others unix-like systems.

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:

  1. Make a new user and create his home directory in /export/home:
    useradd -d /export/home/testuser -m testuser
  2. Change it's home directory to /home:
    usermod -d /home/testuser testuser
  3. 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