Sun Microsystems, Inc.
spacer | | |  
black dot
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
User Commandsnismkdir(1)


 nismkdir - create NIS+ directories


 nismkdir [-D defaults] [-m hostname] [-s hostname] dirname



The nismkdir command creates new NIS+ subdirectories within an existing domain. It can also be used to create replicated directories. Without options, this command will create a subdirectory with the same master and the replicas as its parent directory.

It is advisable to use nisserver(1M) to create an NIS+ domain which consists of the specified directory along with the org_dir and groups_dir subdirectories.

The two primary aspects that are controlled when making a directory are its access rights, and its degree of replication.

A host that serves a NIS+ directory must be a NIS+ client in a directory above the one it is serving. The exceptions to this rule are the root NIS+ servers, which are both clients and servers of the same NIS+ directory.

When the host's default domain is different from the default domain on the client where the command is executed, the hostname supplied as an argument to the -s or -m options must be fully qualified.

Special per-server and per-directory access restrictions may apply when this command updates the serving lists of the affected NIS+ servers. See nisopaccess(1).



The following options are supported:

-D defaults
Specify a different set of defaults to be used when creating new directories. The defaults string is a series of tokens separated by colons. These tokens represent the default values to be used for the generic object properties. All of the legal tokens are described below.
This token sets the default time to live for objects that are created by this command. The value time is specified in the format as defined by the nischttl (1) command. The default value is 12h (12 hours).
This token specifies that the NIS+ principal ownername should own the created object. The default for this value is the principal who is executing the command.
This token specifies that the group groupname should be the group owner for the object that is created. The default value is NULL.
This token specifies the set of access rights that are to be granted for the given object. The value rights is specified in the format as defined by the nischmod(1) command. The default value is ----rmcdr---r---.
-m hostname
If the directory named by dirname does not exist, then a new directory that is not replicated is created with host hostname as its master server.

If the directory name by dirname does exist, then the host named by hostname is made its master server.

-s hostname
Specify that the host hostname will be a replica for an existing directory named dirname.



The following operand is supported:

The fully qualified NIS+ name of the directory that has to be created.


 Example 1. Using the nismkdir Command

To create a new directory bar under the domain that shares the same master and replicas as the directory one would use the command:

example% nismkdir

To create a new directory that is not replicated under the domain one would use the command:

example% nismkdir -m

To add a replica server of the directory, one would use the command:

example% nismkdir -s


This variable contains a defaults string that will override the NIS+ standard defaults. If the -D switch is used those values will then override both the NIS_DEFAULTS variable and the standard defaults.
If this variable is set, and the NIS+ directory name is not fully qualified, each directory specified will be searched until the directory is found (see nisdefaults(1)).



The following exit values are returned:

Successful operation.
Operation failed.



See attributes(5) for descriptions of the following attributes:




nis+(1), nischmod(1), nischttl(1), nisdefaults(1), nisls(1), nisopaccess(1), nisrmdir(1), nisserver(1M), attributes(5)



NIS+ might not be supported in future releases of the Solaris Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit

SunOS 5.9Go To TopLast Changed 10 Dec 2001

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.