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

Commands Reference, Volume 3


mknfsexp Command

Purpose

Exports a directory to NFS clients.

Syntax

/usr/sbin/mknfsexp -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 mknfsexp command takes the flags and parameters specified and constructs a line that is syntactically correct for the /etc/exports file. If this command is invoked with the -B flag, an entry will be added to the /etc/exports file and the exportfs command is invoked to export the directory specified. Alternatively, the -I flag adds an entry to the exports file and does not export the directory, or the -N flag does not add an entry to the exports file but does export the directory.

Flags


-d Directory Specifies the directory that is to be exported or changed.
-f Exports_File Specifies the full path name of the exports file to use if other than the /etc/exports file.
-t Type Specifies whether the directory is read-write, read-only, or read-mostly. The possible values for the Type variable are:

rw
Exports the read-write directory. This is the system default.

ro
Exports the read-only directory.

rm
Exports the read-mostly directory. If chosen, the -h flag must be used to specify the hosts that have read-write permission.
-h HostName [ , HostName ] ... Specifies which hosts have read-write access to the directory. This option is valid only when the exported file is to be read-mostly.
-a UID Uses the UID variable 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.
-r HostName [ , HostName ] ... Gives root users on the specified hosts access to the directory. The default is for no hosts to be granted root access.
-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.
-s Requires clients to use a more secure protocol when accessing the directory.
-n Does not require the client to use the more secure protocol. This flag is the default.
-B Adds an entry to the /etc/exports file and the exportfs command is executed to export the directory. This flag is the default.
-I Adds an entry to the /etc/exports file so that the next time the exportfs command is run during system restart, the directory will be exported.
-N Does not add an entry to the /etc/exports file but the exportfs command is run with the correct parameters so that the directory is exported.
-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.

Examples

  1. To export a directory with read-only permission, enter:

    mknfsexp -d /usr -t ro
    

    In this example, the mknfsexp command exports the /usr directory with read-only permission.

  2. To export a directory with read-mostly permission and a secure protocol to specific hosts, enter:

    mknfsexp -d /home/guest -t rm -h bighost,littlehost -s
    

    In this example the mknfsexp command exports the /home/guest directory with read-mostly permission, using more secure protocol.

  3. To export a directory with read-write permission to a specific netgroup and specific hosts, and to make the export effective on the next system restart, enter:

    mknfsexp -d /usr -t rw -c host1,host3,grp3 -I 
    

    In the above example, the mknfsexp command exports the /usr directory and gives read and write permission to host1, host2, and grp3. The -I flag makes this change effective on the next system restart.

  4. To export a directory with read-only permission to an exports file other than /etc/exports, enter:

    mknfsexp -d /usr -t ro -f /etc/exports.other
    

    In the above example, the mknfsexp command exports the /usr directory with read-only permission to the /etc/exports.other file.

Files


/etc/exports Lists the directories that the server can export.

Related Information

The chnfsexp command, exportfs command, rmnfsexp command.

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

List of NFS Commands.


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