The option rw (read-write) is set in all the preceding lines. However, the option ro allows read-only access if you want.

As we noted previously, the /etc/exports file is simply a collection of lines like those we've shown. The comment character is #. So the following might be a simple complete /etc/exports:

# See the exports(5) manpage for a description of the syntax of this file.

# This file contains a list of all directories that are to be exported to

# other computers via NFS (Network File System).

# This file is used by rpc.nfsd and rpc.mountd. See their manpages for details

# on how to make changes in this file effective. /data2/ *(sync)

/home/peter/ rabbit(rw,root_squash,sync) /home/david/ *(rw,root_squash,sync) /media/cdrom/ *(sync)

In this example, the comments at the top are all that you will see in /etc/exports on a new installation. The directory /data2 is exported read-only (that's the default if neither ro nor rw is specified) to any host. Peter's home directory is exported read-write with the root_squash option, but only to his machine named rabbit. If he becomes root on rabbit, he still won't have root privileges over the files in the share. The CD drive is exported to all hosts.

Once you have made changes to the /etc/exports file and run the command rcnfsserver reload, the shares that you have defined should be available to the clients. So, for instance, on the host rabbit you should be able to mount the share /home/peter on bible with a command like the following:

Was this article helpful?

0 0

Post a comment