System Administration Guide: Naming and Directory Services (NIS+)

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