[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1

chnfsexp Command

Purpose

Changes the options used to export a directory to NFS clients.

Syntax

/usr/sbin/chnfsexp -d Directory [ -f Exports_file ] [ -t [ { rw | ro | rm -h HostName [ ,HostName ... ] } ] ] [ -a UID ] [ -r HostName [ , HostName ... ] ] [ -c HostName , HostName ... ] ] [ -s | -n ] [ -I | -B | -N ] [ -P | -p ]

Description

The chnfsexp command takes as a parameter a directory that is currently exported to NFS clients and changes the options used to export that directory. The options specified on the command line will replace those currently being used.

Flags

-a UID Uses the UID parameter as the effective user ID only if a request comes from an unknown user. The default value of this option is -2.
Note
Root users (uid 0) are always considered "unknown" by the NFS server, unless they are included in the root option. Setting the value of UID to -1 disables anonymous access.
-B Updates the entry in the /etc/exports file and the exportfs command is executed to again export the directory immediately.
-c HostName [ , HostName ] ... Gives mount access to each of the clients listed. A client can either be a host or a netgroup. The default is to allow all hosts access.
-d Directory Specifies the exported directory that is to be changed.
-f Exports_file Specifies the full path name of the exports file to use if other than the /etc/exports file.
-h Hostname [ , HostName ] ... Specifies which hosts have read-write access to the directory. This option is valid only when the directory is exported read-mostly.
-I Adds an entry in the /etc/exports file so that the next time the exportfs command is run, usually during system restart, the directory will be exported.
-N Does not modify the entry in the /etc/exports file but the exportfs command is run with the correct parameters so that the export is changed.
-n Does not require client to use the more secure protocol. This flag is the default.
-P Specifies that the exported directory is to be a public directory. This flag only applies to AIX 4.2.1 or later.
-p Specifies that the exported directory is not a public directory. This flag only applies to AIX 4.2.1 or later.
-r HostName [ , HostName ] ... Gives root users on specified hosts access to the directory. The default is for no hosts to be granted root access.
-s Requires clients to use a more secure protocol when accessing the directory.
-t Type Specifies one of the following types of mount access allowed to clients:
rw
Exports the directory with read-write permission. This is the default.
ro
Exports the directory with read-only permission.
rm
Exports the directory with read-mostly permission. If this type is chosen, the -h flag must be used to specify hosts that have read-write permission.

Examples

  1. To change the list of hosts that have access to an exported directory and to make this change occur immediately and upon each subsequent system restart, enter:

    chnfsexp     -d     /usr     -t     rw     -c     host1,host3,host29,grp3,grp2     -B 

    In this example, the chnfsexp command changes the attributes of the /usr directory to give read and write permission to the host1, host3, and host29 hosts, and the grp3 and grp2 netgroups.

  2. To change the list of hosts that have access to an exported directory, to specify the path name of the exports file, and to make this change occur immediately and upon each subsequent system restart, enter:

    chnfsexp     -d     /usr     -t     rw     -c     host1,host3,host29,grp3,grp2
                 -f     /etc/exports.other     -B

    In this example, the chnfsexp command changes the attributes of the /usr directory to give read and write permission to the host1, host3, and host29 hosts: the grp3 and grp2 netgroups; and specifies the path name of the exports file as /etc/exports.other.

Files

/etc/exports Lists directories the server can export.

Related Information

The exportfs command, mknfsexp command, rmnfsexp command.

Network File System (NFS) Overview for System Management in AIX 5L Version 5.2 System Management Guide: Communications and Networks.

List of NFS Commands.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]