nistbladm (用于执行NIS +表管理功能)

瑞兹 发表于 2021-02-18 10:43
浏览次数:
在手机上阅读

在Solaris操作系统上,nistbladm命令用于执行NIS +表管理功能。

查看英文版

目录

1 nistbladm 运行系统环境

2 nistbladm 描述

3 nistbladm 语法

4 nistbladm 例子

nistbladm 运行系统环境

Unix&Linux

nistbladm 描述

nistbladm命令用于管理NIS +表。它执行五项主要操作:创建和删除表,向表中添加条目,修改表中的条目以及从表中删除条目。

尽管NIS +并不限制表或条目的大小,但数据的大小会影响NIS +服务器的性能和磁盘空间要求。NIS +并非旨在存储大量数据,例如文件;相反,指向文件的指针应存储在NIS +中。

NIS +设计经过优化,可支持10,000个对象,总大小为10 MB。如果要求超过上述要求,则建议创建域层次结构,或者表中存储的数据是指向实际数据的指针,而不是数据本身。

创建表时,必须提供表类型,类型和列定义列表。

type是存储在表中的字符串,服务稍后使用该字符串来验证要添加到表中的条目的类型正确。

列定义的语法为:

colname = [flags] [,access]

flags是以下各项的组合:

S 可搜索的。指定可以在列的值上进行搜索(请参阅nismatch)。
I 不区分大小写(仅与S结合使用才有意义)。指定搜索应忽略大小写。
C 地穴。指定应加密列的值。
B 二进制数据(与S结合使用没有意义)。如果未设置,则该列的值应为以null终止的ASCII 字符串。
X XDR编码的数据(仅与B结合使用才有意义)。

accessnischmod命令定义的格式指定。

处理条目时,此命令采用两种形式的条目名称。第一种使用一系列以空格分隔的colname value对,它们指定条目中的列值。第二个是NIS +索引名称indexedname,其形式为:

[ colname = value,...],tablename

The nistbladm command is used to administer NIS+ tables. There are five primary operations that it performs: creating and deleting tables, adding entries to tables, modifying entries within tables, and removing entries from tables.

Though NIS+ does not place restrictions on the size of tables or entries, the size of data has an impact on the performance and the disk space requirements of the NIS+ server. NIS+ is not designed to store huge pieces of data, such as files; instead, pointers to files should be stored in NIS+.

NIS+ design is optimized to support 10,000 objects with a total size of 10 megabytes. If the requirements exceed the above, it is suggested that the domain hierarchy be created, or the data stored in the tables be pointers to the actual data, instead of the data itself.

When creating tables, a table type, type, and a list of column definitions must be provided.

type is a string that is stored in the table and later used by the service to verify that entries being added to it are of the correct type.

Syntax for column definitions is:

colname=[flags][,access]

flags is a combination of:

S Searchable. Specifies that searches can be done on the column's values (see nismatch).
I Case-insensitive (only makes sense in combination with S). Specifies that searches should ignore case.
C Crypt. Specifies that the column's values should be encrypted.
B Binary data (does not make sense in combination with S). If not set, the column's values are expected to be null terminated ASCII strings.
X XDR encoded data (only makes sense in combination with B).

access is specified in the format as defined by the nischmod command.

When manipulating entries, this command takes two forms of entry name. The first uses a series of space separated colname=value pairs that specify column values in the entry. The second is an NIS+ indexed name, indexedname, of the form:

[ colname=value, ... ],tablename

查看英文版

查看中文版

nistbladm 语法

nistbladm -a | -A [-D defaults] colname = value... tablename
nistbladm -a | -A [-D defaults] indexedname
nistbladm -c [-D defaults] [-p path] [-s sep] type colname = [flags] 
             [, access]... tablename
nistbladm -d tablename
nistbladm -e | -E colname = value... indexedname
nistbladm -m colname = value... indexedname
nistbladm -r | -R [colname = value...] tablename
nistbladm -r | -R indexedname
nistbladm -u [-p path] [-s sep] [-t type] [colname = access...] tablename

选项

nistbladm支持以下选项:

-a|A 将条目添加到NIS +表。小写字母“ a ”和大写字母“ A ”之间的区别在于对现有条目的处理。条目的内容由命令行上的column value对指定。将条目添加到表时,必须指定所有列的值。

通常,如果试图将条目添加到表中以覆盖已存在的条目,则NIS +会报告错误。这样可以防止多方添加重复的条目并使其中之一被覆盖。如果要强制添加,则大写的“ A ”指定要添加的条目,即使该条目已经存在。此选项类似于修改 对条目进行操作。
-C 在名称空间中创建一个名为tablename的表。创建的表必须至少具有一列,并且至少一列必须是可搜索的。
-d tablename 销毁名为tablename的表。被销毁的表必须为空。可以使用下面的-R选项删除表的内容。
-e | E 编辑由indexdname指定的表中的条目。indexdname必须唯一地标识单个条目。可以在将更改条目的索引名称的列中编辑值。如果更改导致索引名称不同于indexedname且与另一个现有条目匹配的条目,则

更改(colname value)可能会影响表中的其他条目。在这种情况下,-e选项将失败,并且将报告错误。该-E选项将强制更换的新条目(有效去除两个旧条目并添加一个新的)现有的条目。
-m -E的同义词。该选项已由-E选项取代。
-r | R 从表中删除条目。xentry由命令行上的一系列column value对指定,或者由指定为entryname的索引名称指定。小写字母“ r ”与大写字母“ R ”的解释之间的区别在于对非唯一输入规范的处理。通常,当为该条目指定的搜索条件解析为表中的多个条目时,NIS +服务器将不允许尝试删除该条目。但是,有时希望删除多个条目,例如,当您尝试从表中删除所有条目时。在这种情况下,使用大写的' R'将强制NIS +服务器删除所有与传递的搜索条件匹配的条目。如果该条件为空且未指定任何列值,那么将删除表中的所有条目。
-u 更新表的属性。此选项允许更改表的串联路径(-p),分隔符(由(-s指定),列访问权限和表类型字符串(-t)。列数和可搜索的列均不得更改。
-D defaults 创建对象时,此选项指定在此操作期间要使用的一组不同的默认值。默认字符串是一系列用冒号分隔的标记。这些标记表示用于通用对象属性的默认值。所有合法令牌的说明如下:

ttl =time 该令牌为该命令创建的对象设置默认的生存时间。时间值以nischttl命令定义的格式指定。默认值为12小时。
owner= ownername 该令牌指定NIS +主体所有者名称应拥有创建的对象。通常,此值与执行命令的主体相同。
group= groupname 该令牌指定组groupname应该是所创建对象的组所有者。默认值为NULL。
access=rights 该令牌指定要为给定对象授予的访问权限集。值权限以nischmod命令定义的格式指定。默认值为

---- rmcdr --- r ---
-p path 创建或更新表时,此选项指定表的搜索路径。当nis_list()被调用功能,用户可以指定标志FOLLOW_PATH告诉客户机库继续搜索在表的路径表,如果使用不产生任何条目的搜索条件。路径由表名的有序列表组成,用冒号分隔。路径中的名称必须完全限定。
-s sep 创建或更新表时,此选项指定表的分隔符。niscat在标准输出上显示表时使用分隔符。当表格为ASCII形式时,其目的是分隔列数据。默认值为空格。
-t type 更新表时,此选项指定表的类型字符串。

环境

nistbladm使用以下环境变量:

NIS_DEFAULTS 该变量包含一个默认字符串,它将覆盖NIS +标准默认值。如果使用-D开关,则这些值将覆盖NIS_DEFAULTS变量和标准默认值。
NIS_PATH 如果设置了此变量,并且NIS +表名不是完全限定的,则将搜索指定的每个目录,直到找到该表为止。
nistbladm -a | -A [-D defaults] colname = value... tablename
nistbladm -a | -A [-D defaults] indexedname
nistbladm -c [-D defaults] [-p path] [-s sep] type colname = [flags] 
             [, access]... tablename
nistbladm -d tablename
nistbladm -e | -E colname = value... indexedname
nistbladm -m colname = value... indexedname
nistbladm -r | -R [colname = value...] tablename
nistbladm -r | -R indexedname
nistbladm -u [-p path] [-s sep] [-t type] [colname = access...] tablename

Options

The following options are supported by nistbladm:

-a | A Adds entries to an NIS+ table. The difference between the lowercase 'a' and the uppercase 'A' is in the treatment of preexisting entries. The entry's contents are specified by the column=value pairs on the command line. Values for all columns must be specified when adding entries to a table.

Normally, NIS+ reports an error if an attempt is made to add an entry to a table that would overwrite an entry that already exists. This prevents multiple parties from adding duplicate entries and having one of them get overwritten. If you want to force the add, the uppercase 'A' specifies that the entry is to be added, even if it already exists. This option is analogous to a modify operation on the entry.
-c Creates a table named tablename in the namespace. The table that is created must have at least one column and at least one column must be searchable.
-d tablename Destroys the table named tablename. The table that is being destroyed must be empty. The table's contents can be deleted with the -R option below.
-e | E Edits the entry in the table that is specified by indexdname. The indexdname must uniquely identify a single entry. It is possible to edit the value in a column that would change the indexed name of an entry.

The change (colname=value) may affect other entries in the table if the change results in an entry whose indexed name is different from indexedname and which matches that of another existing entry. In this case, the -e option will fail and an error will be reported. The -E option will force the replacement of the existing entry by the new entry (effectively removing two old entries and adding a new one).
-m A synonym for -E. This option has been superseded by the -E option.
-r | R Removes entries from a table. The xentry is specified by either a series of column=value pairs on the command line, or an indexed name that is specified as entryname. The difference between the interpretation of the lowercase 'r' versus the uppercase 'R' is in the treatment of non-unique entry specifications. Normally the NIS+ server will disallow an attempt to remove an entry when the search criterion specified for that entry resolves to more than one entry in the table. However, it is sometimes desirable to remove more than one entry, as when you are attempting to remove all of the entries from a table. In this case, using the uppercase 'R' will force the NIS+ server to remove all entries matching the passed search criterion. If that criterion is null and no column values specified, then all entries in the table will be removed.
-u Updates attributes of a table. This option allows the concatenation path (-p), separation character (specified with the (-s)), column access rights, and table type string (-t) of a table to be changed. Neither the number of columns, nor the columns that are searchable may be changed.
-D defaults When creating objects, this option specifies a different set of defaults to be used during this operation. 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:

ttl=time 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 command. The default value is 12 hours.
owner=ownername This token specifies that the NIS+ principal ownername should own the created object. Normally this value is the same as the principal who is executing the command.
group=groupname This token specifies that the group groupname should be the group owner for the object that is created. The default value is NULL.
access=rights 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 command. The default value is

----rmcdr---r---
-p path When creating or updating a table, this option specifies the table's search path. When an nis_list() function is invoked, the user can specify the flag FOLLOW_PATH to tell the client library to continue searching tables in the table's path if the search criteria used does not yield any entries. The path consists of an ordered list of table names, separated by colons. The names in the path must be fully qualified.
-s sep When creating or updating a table, this option specifies the table's separator character. The separator character is used by niscat when displaying tables on the standard output. Its purpose is to separate column data when the table is in ASCII form. The default value is a space.
-t type When updating a table, this option specifies the table's type string.

Environment

nistbladm makes use of the following environment variables:

NIS_DEFAULTS This variable contains a defaults string that will be 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.
NIS_PATH If this variable is set, and the NIS+ table name is not fully qualified, each directory specified will be searched until the table is found.

查看英文版

查看中文版

nistbladm 例子

nistbladm -m name=robert [name=bob],hobbies

修改名为bob的条目,将名称更改为robert

nistbladm -m name=robert [name=bob],hobbies

Modify the entry named bob, changing the name to robert.

查看英文版

查看中文版

其他命令行

newalias | newform | newgrp | niscat | nischmod | nischown | nischttl | nisdefaults | nl | nohup | nroff | nc | nisgrep | nispasswd | nice |

如此好文,分享给朋友
发表评论
验证码:
评论列表
共0条