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

Commands Reference, Volume 4

nismkdir Command


Creates non-root NIS+ directories.


nismkdir-D Defaults ] [  -m MasterHost |   -s ReplicaHost ] DirName


The nismkdir command creates subdirectories within an existing domain. It can also create replicated directories. Without any flags, the nismkdir command creates a subdirectory with the same master server and replica servers as its parent directory's. In addition, the nismkdir command can add a replica to an already existing directory.

A host that serves an NIS+ directory must be an NIS+ client in a directory above the one being served. The only exception is a root NIS+ server that acts as both client and server to the same NIS+ directory.

If the host's default domain is not the domain where the nismkdir command is executed, then the host name specified in the parameter with the -s or -m flags must be fully qualified.

Note: You should use the nisserver command to create an NIS+ domain that consists of the named directory with the org_dir and group_dir.


-m MasterHost If the directory named by the DirName parameter does not yet exist, then the -m flag creates the new directory with MasterHost as its master server. If the directory named by DirName does exist, then the host named by the MasterHost parameter becomes its master server.

Note: To create a directory you must have create rights to the parent directory on that domain master server.
-s ReplicaHost Adds a nonroot NIS+ directory and its master server to an existing system. Also, the -s flag can assign a new replica server to an existing directory. If DirName already exists, then the nismkdir command does not recreate it. Instead, it only assigns the new replica server to that existing directory.

After invoking the -s flag, you must run the nisping command from the master server on the directory that was added or assigned the replica server. You should include a nisping command for each directory in its master server's cron file so that it is pinged at least once every 24 hours before being updated.

  1. You cannot assign a server to support its parent domain, unless it belongs to the root domain.
  2. Always run the nismkdir command on the master server. Never run nismkdir on the replica server. Running nismkdir on the replica server causes communication problems between the master and the replica.
-D Defaults Specifies a different set of defaults for the new directory. The defaults string is a series of tokens each separated by a colon. These tokens represent the default values to be used for the generic object properties:
Sets the default time-to-live for objects created by the nismkdir command. The value Time is specified in the format defined by the nischttl command. The default value is 12h (12 hours).
Specifies that the NIS+ principal Ownername should own the created object. The default for this value is the principal who is executing the command.
Specifies that the group Groupname should be the group owner for the object created. The default value is NULL.
Specifies the set of access rights to be granted for the created object. The value Rights must be given in the format defined by the nischmod command. The default value is ----rmcdr---r---.


NIS_DEFAULTS Contains a defaults string that overrides the NIS+ standard defaults. If the -D flag is invoked then those values override both the NIS_DEFAULTS variable and the standard defaults.
NIS_PATH If the NIS+ directory name is not fully qualified, searches all directories specified until the directory is found (see nisdefaults).

Exit Status

This command returns the following the exit values:

0 Successful completion.
1 An error occurred.


  1. To create the new directory bar under the abc.com. domain that shares the same master and replicas as the abc.com. directory, enter:

    nismkdir def.abc.com.
  2. To create the new directory def.abc.com. that is not replicated under the abc.com. domain, enter:

    nismkdir\ \-m myhost.abc.com.\ def.abc.com.
  3. To add a replica server of the def.abc.com. directory, enter:

    nismkdir\ \-s replica.abc.com.\ def.abc.com.


Related Information

The nischmod command, nisdefaults command, nisls command, nisrmdir command, and nisserver command.

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