JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Naming and Directory Services (NIS+)
search filter icon
search icon

Document Information


Part I About Naming and Directory Services

1.  Name Service Switch

Part II NIS+ Setup and Configuration

2.  NIS+: An Introduction

3.  NIS+ Setup Scripts

4.  Configuring NIS+ With Scripts

5.  Setting Up the NIS+ Root Domain

6.  Configuring NIS+ Clients

7.  Configuring NIS+ Servers

8.  Configuring an NIS+ Non-Root Domain

9.  Setting Up NIS+ Tables

Part III NIS+ Administration

10.  NIS+ Tables and Information

11.  NIS+ Security Overview

12.  Administering NIS+ Credentials

13.  Administering NIS+ Keys

14.  Administering Enhanced NIS+ Security Credentials

15.  Administering NIS+ Access Rights

16.  Administering NIS+ Passwords

17.  Administering NIS+ Groups

18.  Administering NIS+ Directories

19.  Administering NIS+ Tables

NIS+ Table Administration

Using the nistbladm Command With NIS+ Tables

nistbladm Syntax Summary

nistbladm and NIS+ Column Values

nistbladm, Searchable NIS+ Columns, Keys, and Column Values

nistbladm and Indexed NIS+ Names

nistbladm and NIS+ Groups

Creating a New NIS+ Table

Specifying NIS+ Table Columns

Creating Additional NIS+ Automount Tables

Deleting an NIS+ Table

Adding Entries to an NIS+ Table

Adding an NIS+ Table Entry With the -a Option

Adding an NIS+ Table Entry With the -A Option

Modifying NIS+ Table Entries

Editing an NIS+ Table Entry With the -e Option

Editing an NIS+ Table Entry With the -E Option

Removing NIS+ Table Entries

Removing NIS+ Single Table Entries

Removing Multiple Entries From an NIS+ Table

niscat Command

niscat Command Syntax

Displaying the Contents of an NIS+ Table

Displaying the Object Properties of an NIS+ Table or Entry

nismatch and nisgrep Commands

About Regular Expressions in NIS+

nismatch and nisgrep Command Syntax

Searching the First Column in NIS+

Searching a Particular Column in NIS+

Searching Multiple Columns in NIS+

nisln Command

nisln Command Syntax

Creating a Link in NIS+

nissetup Command

Expanding a Directory Into an NIS+ Domain

Expanding a Directory Into an NIS-Compatible Domain

nisaddent Command

nisaddent Command Syntax

Loading Information Into NIS+ From a File

Loading Data From an NIS Map Into NIS+

Dumping the Contents of an NIS+ Table to a File

20.  NIS+ Server Use Customization

21.  NIS+ Backup and Restore

22.  Removing NIS+

23.  Information in NIS+ Tables

24.  NIS+ Troubleshooting

A.  NIS+ Error Messages

About NIS+ Error Messages

Common NIS+ Namespace Error Messages

B.  Updates to NIS+ During the Solaris 10 Release

Solaris 10 and NIS+



nisaddent Command

The nisaddent command loads information from text files or NIS maps into NIS+ tables. It can also dump the contents of NIS+ tables back into text files. If you are populating NIS+ tables for the first time, see the instructions in Populating NIS+ Tables. It describes all the prerequisites and related tasks.

You can use nisaddent to transfer information from one NIS+ table to another (for example, to the same type of table in another domain), but not directly. First, you need to dump the contents of the table into a file, and then load the file into the other table. Be sure, though, that the information in the file is formatted properly. Chapter 10, NIS+ Tables and Information describes the format required for each table.

When you load information into a table, you can use any of three options: replace, append, or merge. The append option simply adds the source entries to the NIS+ table. With the replace option, NIS+ first deletes all existing entries in the table and then adds the entries from the source. In a large table, this adds a large set of entries into the table's .log file (one set for removing the existing entries, another for adding the new ones), taking up space in /var/nis and making propagation to replicas time consuming.

The merge option produces the same result as the replace option but uses a different process, one that can greatly reduce the number of operations that must be sent to the replicas.

With the merge option, NIS+ handles three types of entries differently:

When updating a large table with a file or map whose contents are not greatly different from those of the table, the merge option can spare the server a great many operations. Because the merge option deletes only the entries that are not duplicated in the source (the replace option deletes all entries, indiscriminately), it saves one delete and one add operation for every duplicate entry.

If you are loading information into the tables for the first time, you must have create rights to the table object. If you are overwriting information in the tables, you must have modify rights to the tables.

nisaddent Command Syntax

To load information from text files, use:

/usr/lib/nis/nisaddent -f filename table-type\[domain]
/usr/lib/nis/nisaddent -f filename \
 -t tablename table-type [domain]

To load information from NIS maps, use:

/usr/lib/nis/nisaddent -y NISdomain table-type\
/usr/lib/nis/nisaddent -y NISdomain -t tablename table-type [domain]
/usr/lib/nis/nisaddent -Y map table-type [domain]
/usr/lib/nis/nisaddent -Y map -t tablename table-type [domain]

To dump information from an NIS+ table to a file, use:

/usr/lib/nis/nisaddent -d [-t tablename tabletype] \
 > filename

Loading Information Into NIS+ From a File

You can transfer the contents of a file into an NIS+ table in several different ways:

The following two examples load the contents of a text file named /etc/passwd.xfr into the NIS+ Passwd table. The first is into a table in the local domain, the second into a table in another domain:

rootmaster# /usr/lib/nis/nisaddent -f /etc/passwd.xfr passwd
rootmaster# /usr/lib/nis/nisaddent -f /etc/shadow.xfr shadow
rootmaster# /usr/lib/nis/nisaddent -f /etc/passwd.xfr passwd
rootmaster# /usr/lib/nis/nisaddent -f /etc/shadow.xfr shadow

Note - When creating an NIS+ passwd table from /etc files, you must run nisaddent twice. You run the command once on the /etc/passwd file and once on the /etc/shadow file.

Note - On a system that is running a release prior to the Solaris 10 7/07 release, you must place IPv6 addresses into NIS+. To merge entries from the /etc/inet/ipnodes file (IPv6 addresses) into the ipnodes.org_dir table, use the -v and -f options.

rootmaster# /usr/lib/nis/nisaddent -mv -f  /etc/inet/ipnodes ipnodes

Another way is to use stdin as the source. However, you cannot use the -m option with stdin. You can use redirect (->) or pipe (-|), but you cannot pipe into another domain.

cat filename > nisaddent table-type
Redirect with append option
cat filename > nisaddent -a table-type
Redirect with append into another domain
cat filename > nisaddent -a table-type NIS+ domain
cat filename | nisaddent table-type
Pipe with append option
cat filename | nisaddent -a table-type

If the NIS+ table is an automounter table or a nonstandard table, add the -t option and the complete name of the NIS+ table.

master# nisaddent -f /etc/auto_home.xfr \
master# nisaddent -f /etc/auto_home.xfr \
  -t key-value

Loading Data From an NIS Map Into NIS+

You can transfer information from an NIS map in two different ways; either by specifying the NIS domain or by specifying the actual NIS map. If you specify the domain, NIS+ will figure out which map file in /var/yp/nisdomain to use as the source, based on the table-type. Note that /var/yp/nisdomain must be local files.

NIS+ Table Type
NIS Map Name
ipnodes.byaddr (Not used as of the Solaris 10 7/07 release)

To transfer by specifying the NIS domain, use the -y (lowercase) option and provide the NIS domain in addition to the NIS+ table type.

Table replacement

nisaddent -y nisdomain table-type

Table append

nisaddent -a -y nisdomain table-type

Table merge

nisaddent -m -y nisdomain table-type

By default, nisaddent replaces the contents of the NIS+ table with the contents of the NIS map. Use the -a and -m options to append or merge. Here is an example that loads the NIS+ passwd table from its corresponding NIS map (passwd.byname) in the old-doc domain:

rootmaster# /usr/lib/nis/nisaddent -y old-doc passwd

This example does the same thing, but for the domain instead of the local domain,

rootmaster# /usr/lib/nis/nisaddent -y old-doc passwd

If the NIS+ table is an automounter table or a nonstandard table, add the -t option and the complete name of the NIS table, just as you would if the source were a file.

rootmaster# nisaddent -y old-doc \
  -t key-value
rootmaster# nisaddent -y old-doc \
  -t key-value

If instead of using the map files for a domain, you prefer to specify a particular NIS map, use the -Y (uppercase) option and specify the map name.

rootmaster# nisaddent -Y hosts.byname hosts
rootmaster# nisaddent -Y hosts.byname hosts

If the NIS map is an automounter map or a non standard map, combine the -Y option with the -t option:

rootmaster# nisaddent -Y auto_home 
 -t key-value
rootmaster# nisaddent -Y auto_home 
 -t key-value

Dumping the Contents of an NIS+ Table to a File

To dump the contents of an NIS+ table into a file, use the -d and -t options. The -d options tells the command to dump, and the -t option specifies the NIS+ table:

rootmaster# nisaddent -d auto_home 
 -t key-value 
rootmaster# nisaddent -d auto_home 
 -t key-value