autofs to automatically mount ldap user’s home

In ipa server: (Serving home directory remotely)

  1. Create home directory of each users you have added in IPA server for example user  reewa was created (Note: when you create user in IPA Server or LDAP home directory will not be automatically created):
    cp -r /etc/skel /home/reewa
    chown -R reewa.reewa /home/reewa
  2. Export /home in NFS
    echo “/home *(rw)” >> /etc/exports
    systemctl enable nfs-server
    systemctl start nfs-server

Configuring client machine to automatically mount /remote_host/reewa on login

In Desktop1:

  1. add autofs record in auto.master to point /remote_home to use /etc/auto.master file
    echo “/remote_home /etc/auto.remote_user” >> /etc/auto.master
  2. if required, auto.misc contains sample. use “grep ftp” to find right line. I am about to write directly into /etc/auto.remote_user file
    echo “reewa   server1.shiba.local:/home/reewa” >  /etc/auto.remote_user
  3. enable autofs and restart service
    systemctl enable autofs
    systemctl restart autofs

Note: in auto.master file /remote_home, is the folder where you want to mount remote NFS share, you don’t need to create /remote_home. Similarly, /etc/auto.remote_user file contains mapping of reewa user’s home directory from NFS server, so that when ever, anybody tries to access /remote_home/reewa, it will map to server1.shiba.local:/home/reewa.

You can test if autofs is properly working or not with use change to the directory, you don’t need to loging using reewa to test autofs:
cd /remote_home/reewa

Note: there is no relation between autofs and ldap, we are just using autofs’s dynamic feature to associate remotely shared folder of ldap users to properly shared remote directory.

Recent Posts
Recent Comments
    Updates on Recent activieies