Displays the seven default values currently active in the namespace.
nisdefaults [ -d domain ] [ -g group ] [ -h host ] [ -p principal ] [ -r access_rights ] [ -s search_path ] [ -t time_to_live ] [ -a all(terse) ] [ -v verbose ]
The nisdefaults command displays the seven default values currently active in the namespace. To display NIS+ defaults the default values are either:
Any object that you create on this machine will automatically acquire these default values unless you override them with the -D flag of the command you are using to create the object.
This section describes how to perform tasks related to the nisdefaults command, the NIS_DEFAULTS environment variable, and the -D flag. The NIS_DEFAULTS environment variable specifies the following default values:
The values that you set in the NIS_DEFAULTS environment variable are the default values applied to all NIS+ objects that you create using that shell (unless overridden by using the -D flag with the command that creates the object).
You can specify the default values (owner, group, access rights, and time-to-live) specified with the NIS_DEFAULTS environment variable. Once you set the value of NIS_DEFAULTS, every object you create from that shell will acquire those defaults, unless you override them by using the -D flag when you invoke a command.
You can check the setting of an environment variable by using the echo command, as shown below:
client% echo $NIS_DEFAULTS owner=butler:group=gamblers:access=o+rmcd
You can also display a general list of the NIS+ defaults active in the namespace by using the nisdefaults command.
You can change the default access rights, owner, and group, by changing the value of the NIS_DEFAULTS environment variable. Use the environment command that is appropriate for your shell (setenv for csh or $NIS_DEFAULTS=, export for sh and ksh) with the following arguments:
You can combine two or more arguments into one line separated by colons:
Table 1-1. Changing Defaults--Examples
|This command grants owner read access as the default access right.||client% setenv NIS_DEFAULTS access=o+r|
|This command sets the default owner to be the user abe whose home domain is Wiz.com.||client% setenv NIS_DEFAULTS owner=abe.wiz.com.|
|This command combines the first two examples on one code line.||client% setenv NIS_DEFAULTS access=o+r:owner=abe.wiz.com.|
All objects and entries created from the shell in which you changed the defaults will have the new values you specified. You cannot specify default settings for a table column or entry; the columns and entries simply inherit the defaults of the table.
You can reset the NIS_DEFAULTS variable to its original values, by typing the name of the variable without arguments, using the format appropriate to your shell:
For C shell:
client# unsetenv NIS_DEFAULTS
For Bourne or Korn shell:
client$ NIS_DEFAULTS=; export NIS_DEFAULTS
|-d domain||Displays the home domain of the workstation from which the command was entered. Displays the value of /etc/defaultdomin environment variable.|
|-g group||Displays the group that would be assigned to the next object created from this shell. Displays the value of NIS_GROUP environment variable.|
|-h host||Displays the workstation's host name. Displays the value of uname -n environment variable.|
|-p principal||Displays the fully qualified user name or host name of the NIS+ principal who entered the nisdefaults command. Displays the value of gethostbyname() environment variable.|
|-r access_rights||Displays the access rights that will be assigned to the next object or entry created from this shell. Format: ----rmcdr---r---. Displays the value of NIS_DEFAULTS environment variable.|
|-s search_path||Displays the syntax of the search path, which indicate the domains that NIS+ will search through when looking for information. Displays the value of the NIS_PATH environment variable if it is set. Displays the value of NIS_PATH environment variable.|
|-t time_to_live||Displays the time-to-live that will be assigned to the next object created from this shell. The default is 12 hours. Displays the value of the NIS_DEFAULTS environment variable.|
|-a all (terse)||Displays all seven defaults in terse format. Displays the value of the environment variable.|
|-v verbose||Display specified values in verbose mode. Displays the value of the environment variable.|
You can use these options to display all default values or any subset of them.
master% nisdefaults Principal Name : topadmin.wiz.com. Domain Name : Wiz.com. Host Name : rootmaster.wiz.com. Group Name : salesboss Access Rights : ----rmcdr---r--- Time to live : 12:00:00:00:00 Search Path : Wiz.com.
rootmaster% nisdefaults -rs ----rmcdr---r--- Wiz.com.