# NFS exports

## Task 1:

Configure autofs to automount the home directories of LDAP users as follows:

`host.domain11.example.com`NFS-exports `/home`to your system.

This filesystem contains a pre-configured home directory for the user `ldapuser11`. `ldapuser11`'s home directory is host.domain11.example.com/rhome/ldapuser11.&#x20;

ldapuser11's home directory should be automated locally beneath /rhome as /rhome/ldapuser11

Home directories must be writeable by their users.

`ldapuser11`'s password is `password`

Solution:

```
useradd ldapuser11
passwd --stdin ldapuser11
mkdir /home
yum install autofs
```

```
vim /etc/auto.master

#add the line into auto.misc file
/rhome /etc/auto.misc 

# add the line to auto.misc file
ldapuser11 --rw,sync host.domain.example.com:/rhome/ldapuser11
```

```
systemctl restart autofs
chown -R ldapuser11:ldapuser11 /rhome/ldapuser11
chmod 700 /rhome/ldapuser11
```

## Task 2:

Some users home directory is shared from your system. Using `showmount -e localhost`command, the shared directory is not shown. Make access the shared users home directory.

Solution:

```
yum install nfs-utils -y

vim /etc/exports
/home 192.168.0.0/24(rw,sync,no_root_squash)

systemctl start nfs-server
systemctl enable nfs-server
exportfs -a
showmount -e localhost
```
