6.3. Exporting a Directory

Only directories on local filesystems can be exported via NFS, so it is not possible to re-export files that have been mounted from another NFS server. It is also not possible to export directories from non-UNIX filesystems such as vfat, ntfs or iso9660. If an exported directory has mount points under it, files under those mount points will not be accessible by NFS clients. So if you exported the root directory / and it has a separate filesystem mounted at /home, you would need to also export /home and clients would need to mount it in order to see the files under it.

The steps for exporting a directory are:

1.
Click on the Add a new export link on the main page of the module. This will take you to a form for entering the details of the export, as shown in Figure 6.2.

Figure 6.2. The new NFS export form.


2.
Enter the directory that you want to share in the Directory to export field.

3.
Unless you want the export to be unavailable, make sure the Active? option is set to Yes.

4.
The Export to option allows you to choose which clients will have access to the directory. The possible choices are:

Everyone Any system that can connect to yours over the network will be able to mount the directory. Be very careful with this choice, as it may allow anyone on the Internet to access your files.

Host(s) Only the single specified host or IP address will be allowed. You can also enter a wildcard hostname like *.foo.com for this option to allow all hosts from a domain. However, if you want to export a directory to several specific client hosts then the only solution is to create multiple exports of the same directory, each with a different hostname in this field.

WebNFS clients WebNFS is a rarely used protocol for accessing NFS exports over the Internet. Don't use this option unless you know what you are doing, as it may allow anyone to access your files.

Netgroup A netgroup is a list of hosts that is defined on an NIS server. Unfortunately, your system must be an NIS client for this to be useful.

Network and Netmask All hosts on the specified network will be allowed to connect. To allow all hosts with IP addresses from 192.168.1.0 to 192.168.1.255, you would enter 192.168.1.0 for the network, and 255.255.255.0 for the netmask.

5.
If you want to prevent clients from modifying or creating files in the exported directory, set the Access mode option to Read only.

6.
If exporting only to trusted systems, set the Trust remote users option to Everyone.

If you want to ensure that clients only have the permissions of a single UNIX user, however, set Trust remote users to Nobody and enter the user and his primary group into the Treat untrusted users as and Treat untrusted groups as fields respectively. This can be very useful if exporting to a client workstation that is used by single user.

7.
Click the Create button to save the export. If you have made any mistakes in any of the fields, an explanatory error message will be displayed. Otherwise, the browser will return to the list of exports.

8.
Click the Apply Changes button to make your new export active.

Allowed clients should now be able to mount the exported directory. If not, check your system's error logs for messages from the NFS server processes that explain why the client is being rejected.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.8.91