NFS version 4 for Linux /etc/exports file format

NFS version 4 for Linux /etc/exports file format

Every entry in the /etc/exports file looks like this.


export path ([pseudo=pseudo path[,ro][,rw][,sec=option[:option;]])

WARNING: Currently we have a bug which prevents mounting a directory that has krb5 security. You may mount a directory above the krb5-protected directory, and then descend into the directory, but if you attempt to mount the krb5-directory directly, you will get an error. Also, with kernels compiled from recent code from cvs, specifying any security flavor on a filesystem that is exported as root may cause an error on export.

Here's a list of valid security options:

Note: currently, only krb5 is implemented.

# - Comments out the rest of the line

Example of an /etc/exports file.

/export		(pseudo=/foo,rw)
/usr/local	(pseudo=/goo/dir1,ro)
/usr/share	(pseudo=/goo/dir2,sec=dh:lkeyi)
/usr/man	(pseudo=/goo/dir3,rw,sec=sys)
/usr/doc	(pseudo=/goo/dir4,rw,sec=sys:krb5:krb5i:spkm3)
# a commment

The first line exports the /export directory with full access onto a pseudo /foo directory.

The second line will export /usr/local by putting it onto the pseudo /goo/dir1 and make it read only.

The third line has /usr/share exported on /goo/dir2 (also read-only) with the security options dh or lkeyi.

The fourth entry exports /usr/man with the sys security option.

The last entry is /usr/doc with one of the security options sys, krb5, krb5i, or spkm3.