Writing shares in the “/etc/exports” directory:

There are three fields in the /etc/exports directory they are.

  • Directory name to be shared.
  • Range of the network to mount the directory.
  • Mount options.

 

For example I am taking the sample shares on the /etc/exports file.

[root@sys1 ~]# vim /etc/exports
/repo 192.168.1.6(rw,sync,no_root_squash)

 

exports

 

Mount options we are using to share the file system:

rw                       : sets read and write permissions

ro                        : sets read only permission.

sync                   : specifies that all the changes by the client must be written to the disk.

no_wdely            : Forces the writing of changes immediately.

root_squash       : prevents root access.

no_root_squash : Allows root access.

 

Different tasks for practice:

Write a share to share the file system /repo to 192.168.1.108 with read only permission.

/repo 192.168.1.108(ro,sync)

 

Write a share to share the file system /repo to the hosts ranging from 192.168.1.10 to 192.168.1.100 with read write permissions with root access.

/repo 192.168.1.10/100(rw,sync,no_root_squash)

 

Write a share to share the file system /repo to the hosts on in.ibm.com with read only permissions without root access.

/repo in.ibm.com (ro,sync,root_squash)

 

Topics Summary