LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   nfs homedirs (http://www.linuxquestions.org/questions/linux-networking-3/nfs-homedirs-4175413849/)

bruno.vila 06-28-2012 11:25 AM

nfs homedirs
 
I have the following structure for the home dirs of users

Code:

/home
  |-somedir
      |-school1
          |-user1
          |-user2
            ......
          |-userN
      |-school2
          |-userk1
          |-userk2
            ......
          |-userkN

how can I export theese home dirs and mount them in clients with autofs?

custangro 06-28-2012 11:40 AM

It would help if you mention what OS you're using...

But this is how you'd do it on a Red Hat based system (RHEL/CentOS/Fedora...)

Export the "/home" dir as an NFS share...edit the "/etc/export" file and share it out to your network...

Code:

/home        192.168.1.0/24(rw,no_root_squash)
And start the NFS services

Code:

root@host# service nfs restart
root@host# chkconfig nfs on

Edit the /etc/auto.master and add this

[code]
/rhome /etc/auto.rhome --timeout=60
[code]

Create the /etc/auto.rhome file and add this (where 192.168.1.10 is your NFS server)

Code:

*        -rw,soft,intr        192.168.1.10:/home/school1/&
Start autofs and make sure it starts on boot

Code:

root@host# service autofs restart
root@host# chkconfig autofs on

Now make sure all your users have "/rhome/username" set as their homedir in the /etc/passwd file


All times are GMT -5. The time now is 10:55 AM.