Web space - The anonymous user assigned by NFS is typically
Monday, August 27th, 2007The anonymous user assigned by NFS is typically the “nobody” user name with a UID and GID -2 (because -2 cannot be assigned to a file, UIDs and GIDs of 65534 are assigned when the “nobody” user owns a file). This prevents the ID from running into a valid user or group ID. Using anonuid or anongid, you can change the anonymous user or group, respectively. For example, anonuid=175 sets all anonymous users to UID 175 and anongid=300 sets the GID to 300. User mapping If the same users have login accounts for a set of computers (and they have the same IDs), NFS, by default, will map those IDs. This means that if the user named mike (UID 110) on maple has an account on pine (mike, UID 110), from either computer he could use his own remotely mounted files from the other computer. If a client user that is not set up on the server creates a file on the mounted NFS directory, the file is assigned to the remote client s UID and GID. (An ls -l on the server would show the UID of the owner.) You can identify a file that contains user mappings using the map_static option. Tip The exports man page describes the map_static option, which should let you create a file that contains new ID mappings. These mappings should let you remap client IDs into different IDs on the server. Exporting the shared file systems After you have added entries to your /etc/exports file, you can actually export the directories listed using the exportfs command. If you reboot your computer, the exportfs command is run automatically to export your directories. However, if you want to export them immediately, you can do so by running exportfs from the command line (as root). Tip It s a good idea to run the exportfs command after you change the exports file. If any errors are in the file, exportfs will identify those errors for you. Here s an example of the exportfs command: # /usr/sbin/exportfs -a -v exporting :/pub exporting :/home The -a option indicates that all directories listed in /etc/exports should be exported. The -v option says to print verbose output. In this example, the /pub and /home directories from the local server are now immediately available for mounting by client computers. Tip The /var/lib/nfs/xtab file lists all the options, including the default options, assigned to each of the exported directories. Running the exportfs command temporarily makes your exported NFS directories available. To have your NFS directories available on an ongoing basis (that is, every time your system reboots), you need to configure your nfs start-up scripts to run at boot time. This is described in the next section. Starting the nfs daemons For security purposes, the NFS service is probably turned off by default on your Red Hat Linux system. You can use the chkconfig command to turn on the NFS service so that your files are exported and the nfsd daemons are running when your system boots. There are two start-up scripts you want to turn on for the NFS service to work properly. The nfs service exports file systems (from /etc/exports) and starts the nfsd daemon that listens for service requests. The nfslock service starts the lockd daemon, which helps allow file locking to prevent multiple simultaneous use of critical files over the network.
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.