1
0

shadow.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-shadow" role="wrap">
  8. <?dbhtml filename="shadow.html"?>
  9. <sect1info condition="script">
  10. <productname>shadow</productname>
  11. <productnumber>&shadow-version;</productnumber>
  12. <address>&shadow-url;</address>
  13. </sect1info>
  14. <title>Shadow-&shadow-version;</title>
  15. <indexterm zone="ch-system-shadow">
  16. <primary sortas="a-Shadow">Shadow</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Shadow 软件包包含安全地处理密码的程序。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&shadow-ch6-sbu;</seg>
  26. <seg>&shadow-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Shadow</title>
  32. <note>
  33. <para>如果您希望强制使用强密码,参考
  34. <ulink url="&blfs-book;postlfs/cracklib.html"/> 以在构建 Shadow 前安装
  35. CrackLib,然后为下面的 <command>configure</command> 命令附加
  36. <parameter>--with-libcrack</parameter> 参数。</para>
  37. </note>
  38. <para>禁止该软件包安装 <command>groups</command>
  39. 程序和它的 man 页面,因为 Coreutils 会提供更好的版本。
  40. 同样,避免安装 <xref linkend="ch-system-man-pages"/>
  41. 软件包已经提供的 man 页面:</para>
  42. <screen><userinput remap="pre">sed -i 's/groups$(EXEEXT) //' src/Makefile.in
  43. find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
  44. find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
  45. find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;</userinput></screen>
  46. <para id="shadow-login_defs"> 不使用默认的
  47. <emphasis>crypt</emphasis> 加密方法,使用更安全的
  48. <emphasis>SHA-512</emphasis> 方法加密密码,
  49. 该方法也允许长度超过 8 个字符的密码。另外,还需要把 Shadow
  50. 默认使用的用户邮箱位置
  51. <filename class="directory">/var/spool/mail</filename>
  52. 改为当前普遍使用的 <filename class="directory">/var/mail</filename>
  53. 目录:</para>
  54. <screen><userinput remap="pre">sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD SHA512@' \
  55. -e 's@/var/spool/mail@/var/mail@' etc/login.defs</userinput></screen>
  56. <note>
  57. <para>如果您选择构建有 Cracklib 支持的 Shadow,执行以下命令:</para>
  58. <screen role="nodump"><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' etc/login.defs</userinput></screen>
  59. </note>
  60. <para>进行微小的改动,使 useradd 使用 1000 作为第一个组编号:</para>
  61. <screen><userinput remap="pre">sed -i 's/1000/999/' etc/useradd</userinput></screen>
  62. <para>准备安装 Shadow:</para>
  63. <screen><userinput remap="configure">./configure --sysconfdir=/etc --with-group-name-max-length=32</userinput></screen>
  64. <variablelist>
  65. <title>配置选项的含义:</title>
  66. <varlistentry>
  67. <term><parameter>--with-group-name-max-length=32</parameter></term>
  68. <listitem>
  69. <para>最长用户名可以有 32 个字符,设定组名称最大长度为相同值。
  70. </para>
  71. </listitem>
  72. </varlistentry>
  73. </variablelist>
  74. <para>编译该软件包:</para>
  75. <screen><userinput remap="make">make</userinput></screen>
  76. <para>该软件包不包含测试套件。</para>
  77. <para>安装该软件包:</para>
  78. <screen><userinput remap="install">make install</userinput></screen>
  79. <para>将一个安装位置不正确的程序移动到正确位置:</para>
  80. <screen><userinput remap="install">mv -v /usr/bin/passwd /bin</userinput></screen>
  81. <!-- <para>Move Shadow's libraries to more appropriate locations:</para>
  82. <screen><userinput remap="install">mv -v /lib/libshadow.*a /usr/lib
  83. rm -v /lib/libshadow.so
  84. ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
  85. </sect2>
  86. <sect2 id="conf-shadow" role="configuration">
  87. <title>配置 Shadow</title>
  88. <indexterm zone="conf-shadow">
  89. <primary sortas="a-Shadow">Shadow</primary>
  90. <secondary>configuring</secondary>
  91. </indexterm>
  92. <!--para>This package contains utilities to add, modify, and delete users and
  93. groups; set and change their passwords; and perform other administrative
  94. tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
  95. means, see the <filename>doc/HOWTO</filename> file within the unpacked
  96. source tree. If using Shadow support, keep in mind that programs which need
  97. to verify passwords (display managers, FTP programs, pop3 daemons, etc.)
  98. must be Shadow-compliant. That is, they need to be able to work with
  99. shadowed passwords.</para-->
  100. <para>该软件包包含用于添加、修改、删除用户和组,设定和修改它们的密码,
  101. 以及进行其他管理任务的工具。如果希望查阅关于
  102. <emphasis>password shadowing</emphasis> 的详细解释,
  103. 阅读解压得到源代码目录树中的 <filename>doc/HOWTO</filename>
  104. 文件。如果使用 Shadow 支持,记住所有需要验证密码的程序
  105. (如显示管理器、FTP 程序、pop3 守护进程等)都必须和 Shadow
  106. 兼容。换句话说,它们必须能使用 Shadow 加密的密码。</para>
  107. <note><title>译注</title>
  108. <para>大多数 Linux 程序要么本身支持 Shadow,要么通过 Linux PAM
  109. 支持 Shadow。为了提高安全性,建议启用 Shadow 加密。
  110. </para>
  111. </note>
  112. <para>执行以下命令,对用户密码启用 Shadow 加密:</para>
  113. <screen><userinput>pwconv</userinput></screen>
  114. <para>执行命令,对组密码启用 Shadow 加密:</para>
  115. <screen><userinput>grpconv</userinput></screen>
  116. <!--para>Shadow's stock configuration for the <command>useradd</command>
  117. utility has a few caveats that need some explanation. First, the default
  118. action for the <command>useradd</command> utility is to create the user and
  119. a group of the same name as the user. By default the user ID (UID) and
  120. group ID (GID) numbers will begin with 1000. This means if you don't pass
  121. parameters to <command>useradd</command>, each user will be a member of a
  122. unique group on the system. If this behavior is undesirable, you'll need
  123. to pass the <parameter>-g</parameter> parameter to
  124. <command>useradd</command>. The default parameters are stored in the
  125. <filename>/etc/default/useradd</filename> file. You may need to modify two
  126. parameters in this file to suit your particular needs.</para-->
  127. <para>Shadow 为 <command>useradd</command>
  128. 提供的配置文件有一些需要解释的事项。首先,<command>useradd</command>
  129. 的默认操作是创建一个用户,以及一个名字和用户名相同的组。
  130. 默认情况下,用户 ID (UID)和组 ID (GID)会从 1000 开始。
  131. 这意味着,如果您不向 <command>useradd</command> 传递参数,
  132. 每个用户都会属于一个不同的组。如果您不希望这样,
  133. 就要向 <command>useradd</command> 传递 <parameter>-g</parameter>
  134. 参数。默认参数保存在 <filename>/etc/default/useradd</filename>
  135. 文件中,您可以编辑其中的两个参数,以满足您的特定需求:
  136. </para>
  137. <variablelist>
  138. <title><filename>/etc/default/useradd</filename> 参数解释</title>
  139. <varlistentry>
  140. <term><parameter>GROUP=1000</parameter></term>
  141. <listitem>
  142. <!--para>This parameter sets the beginning of the group numbers used in
  143. the /etc/group file. You can modify it to anything you desire. Note
  144. that <command>useradd</command> will never reuse a UID or GID. If the
  145. number identified in this parameter is used, it will use the next
  146. available number after this. Note also that if you don't have a group
  147. 1000 on your system the first time you use <command>useradd</command>
  148. without the <parameter>-g</parameter> parameter, you'll get a message
  149. displayed on the terminal that says:
  150. <computeroutput>useradd: unknown GID 1000</computeroutput>. You may
  151. disregard this message and group number 1000 will be used.</para-->
  152. <para>该参数设定 /etc/group 文件中使用的第一个组编号,
  153. 您可以将它修改为您希望的任何值。注意
  154. <command>useradd</command> 绝不会重用 UID 或 GID,
  155. 如果该参数指定的数字已经被使用了,它就会使用下一个可用的数字。
  156. 另外,如果在您第一次不加 <parameter>-g</parameter>
  157. 参数使用 <command>useradd</command> 时没有编号 1000 的组,
  158. 您就会在终端看到一条消息:
  159. <computeroutput>useradd: unknown GID 1000</computeroutput>。
  160. 您可以忽略这条消息,它会使用组编号 1000 。</para>
  161. </listitem>
  162. </varlistentry>
  163. <varlistentry>
  164. <term><parameter>CREATE_MAIL_SPOOL=yes</parameter></term>
  165. <listitem>
  166. <!--para>This parameter causes <command>useradd</command> to create a
  167. mailbox file for the newly created user. <command>useradd</command>
  168. will make the group ownership of this file to the
  169. <systemitem class="groupname">mail</systemitem> group with 0660
  170. permissions. If you would prefer that these mailbox files are not
  171. created by <command>useradd</command>, issue the following
  172. command:</para-->
  173. <para>该参数使得 <command>useradd</command>
  174. 为新创建的用户建立邮箱文件。<command>useradd</command>
  175. 会使得 <systemitem class="groupname">mail</systemitem>
  176. 为拥有该文件的组,并为文件赋予 0660 权限码。
  177. 如果您不希望 <command>useradd</command> 创建这些邮箱文件,
  178. 执行以下命令:</para>
  179. <screen><userinput>sed -i 's/yes/no/' /etc/default/useradd</userinput></screen>
  180. </listitem>
  181. </varlistentry>
  182. </variablelist>
  183. </sect2>
  184. <sect2 role="configuration">
  185. <title>设定 root 密码</title>
  186. <para>为用户 <emphasis>root</emphasis> 选择一个密码,
  187. 并执行以下命令设定它:</para>
  188. <screen role="nodump"><userinput>passwd root</userinput></screen>
  189. </sect2>
  190. <sect2 id="contents-shadow" role="content">
  191. <title>Shadow 的内容</title>
  192. <segmentedlist>
  193. <segtitle>安装的程序</segtitle>
  194. <segtitle>安装的目录</segtitle>
  195. <seglistitem>
  196. <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
  197. groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
  198. lastlog, login, logoutd, newgidmap, newgrp, newuidmap, newusers,
  199. nologin, passwd, pwck, pwconv, pwunconv, sg (到 newgrp的链接), su,
  200. useradd, userdel, usermod, vigr (到 vipw 的链接), 以及 vipw</seg>
  201. <seg>/etc/default</seg>
  202. </seglistitem>
  203. </segmentedlist>
  204. <variablelist>
  205. <bridgehead renderas="sect3">简要描述</bridgehead>
  206. <?dbfo list-presentation="list"?>
  207. <?dbhtml list-presentation="table"?>
  208. <varlistentry id="chage">
  209. <term><command>chage</command></term>
  210. <listitem>
  211. <para>用于修改强制性密码更新的最大天数</para>
  212. <indexterm zone="ch-system-shadow chage">
  213. <primary sortas="b-chage">chage</primary>
  214. </indexterm>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry id="chfn">
  218. <term><command>chfn</command></term>
  219. <listitem>
  220. <para>用于修改用户全名和其他信息</para>
  221. <indexterm zone="ch-system-shadow chfn">
  222. <primary sortas="b-chfn">chfn</primary>
  223. </indexterm>
  224. </listitem>
  225. </varlistentry>
  226. <varlistentry id="chgpasswd">
  227. <term><command>chgpasswd</command></term>
  228. <listitem>
  229. <para>用于批量更新组密码</para>
  230. <indexterm zone="ch-system-shadow chgpasswd">
  231. <primary sortas="b-chgpasswd">chgpasswd</primary>
  232. </indexterm>
  233. </listitem>
  234. </varlistentry>
  235. <varlistentry id="chpasswd">
  236. <term><command>chpasswd</command></term>
  237. <listitem>
  238. <para>用于批量更新用户密码</para>
  239. <indexterm zone="ch-system-shadow chpasswd">
  240. <primary sortas="b-chpasswd">chpasswd</primary>
  241. </indexterm>
  242. </listitem>
  243. </varlistentry>
  244. <varlistentry id="chsh">
  245. <term><command>chsh</command></term>
  246. <listitem>
  247. <para>用于改变用户的默认登录 shell</para>
  248. <indexterm zone="ch-system-shadow chsh">
  249. <primary sortas="b-chsh">chsh</primary>
  250. </indexterm>
  251. </listitem>
  252. </varlistentry>
  253. <varlistentry id="expiry">
  254. <term><command>expiry</command></term>
  255. <listitem>
  256. <para>检查并强制当前密码过期策略</para>
  257. <indexterm zone="ch-system-shadow expiry">
  258. <primary sortas="b-expiry">expiry</primary>
  259. </indexterm>
  260. </listitem>
  261. </varlistentry>
  262. <varlistentry id="faillog">
  263. <term><command>faillog</command></term>
  264. <listitem>
  265. <para>用于检查失败登录日志,设定锁定账户的最大失败次数,
  266. 或重置失败次数</para>
  267. <indexterm zone="ch-system-shadow faillog">
  268. <primary sortas="b-faillog">faillog</primary>
  269. </indexterm>
  270. </listitem>
  271. </varlistentry>
  272. <varlistentry id="gpasswd">
  273. <term><command>gpasswd</command></term>
  274. <listitem>
  275. <para>用于增加或删除组的用户和管理员</para>
  276. <indexterm zone="ch-system-shadow gpasswd">
  277. <primary sortas="b-gpasswd">gpasswd</primary>
  278. </indexterm>
  279. </listitem>
  280. </varlistentry>
  281. <varlistentry id="groupadd">
  282. <term><command>groupadd</command></term>
  283. <listitem>
  284. <para>以指定名称创建组</para>
  285. <indexterm zone="ch-system-shadow groupadd">
  286. <primary sortas="b-groupadd">groupadd</primary>
  287. </indexterm>
  288. </listitem>
  289. </varlistentry>
  290. <varlistentry id="groupdel">
  291. <term><command>groupdel</command></term>
  292. <listitem>
  293. <para>删除指定的组</para>
  294. <indexterm zone="ch-system-shadow groupdel">
  295. <primary sortas="b-groupdel">groupdel</primary>
  296. </indexterm>
  297. </listitem>
  298. </varlistentry>
  299. <varlistentry id="groupmems">
  300. <term><command>groupmems</command></term>
  301. <listitem>
  302. <para>在不需要超级用户权限的情况下,
  303. 允许用户管理自己的组成员列表</para>
  304. <indexterm zone="ch-system-shadow groupmems">
  305. <primary sortas="b-groupmems">groupmems</primary>
  306. </indexterm>
  307. </listitem>
  308. </varlistentry>
  309. <varlistentry id="groupmod">
  310. <term><command>groupmod</command></term>
  311. <listitem>
  312. <para>用于修改给定的组名称或 GID</para>
  313. <indexterm zone="ch-system-shadow groupmod">
  314. <primary sortas="b-groupmod">groupmod</primary>
  315. </indexterm>
  316. </listitem>
  317. </varlistentry>
  318. <varlistentry id="grpck">
  319. <term><command>grpck</command></term>
  320. <listitem>
  321. <para>验证组文件
  322. <filename>/etc/group</filename> 和
  323. <filename>/etc/gshadow</filename> 的完整性</para>
  324. <indexterm zone="ch-system-shadow grpck">
  325. <primary sortas="b-grpck">grpck</primary>
  326. </indexterm>
  327. </listitem>
  328. </varlistentry>
  329. <varlistentry id="grpconv">
  330. <term><command>grpconv</command></term>
  331. <listitem>
  332. <para>根据普通组文件创建或更新加密组文件</para>
  333. <indexterm zone="ch-system-shadow grpconv">
  334. <primary sortas="b-grpconv">grpconv</primary>
  335. </indexterm>
  336. </listitem>
  337. </varlistentry>
  338. <varlistentry id="grpunconv">
  339. <term><command>grpunconv</command></term>
  340. <listitem>
  341. <para>根据 <filename>/etc/gshadow</filename> 文件更新
  342. <filename>/etc/gshadow</filename> 文件,并删除前者</para>
  343. <indexterm zone="ch-system-shadow grpunconv">
  344. <primary sortas="b-grpunconv">grpunconv</primary>
  345. </indexterm>
  346. </listitem>
  347. </varlistentry>
  348. <varlistentry id="lastlog">
  349. <term><command>lastlog</command></term>
  350. <listitem>
  351. <para>报告所有用户或给定用户最后一次登录的信息</para>
  352. <indexterm zone="ch-system-shadow lastlog">
  353. <primary sortas="b-lastlog">lastlog</primary>
  354. </indexterm>
  355. </listitem>
  356. </varlistentry>
  357. <varlistentry id="login">
  358. <term><command>login</command></term>
  359. <listitem>
  360. <para>被系统用于允许用户登录</para>
  361. <indexterm zone="ch-system-shadow login">
  362. <primary sortas="b-login">login</primary>
  363. </indexterm>
  364. </listitem>
  365. </varlistentry>
  366. <varlistentry id="logoutd">
  367. <term><command>logoutd</command></term>
  368. <listitem>
  369. <para>是一个限制登录时间和端口的守护进程</para>
  370. <indexterm zone="ch-system-shadow logoutd">
  371. <primary sortas="b-logoutd">logoutd</primary>
  372. </indexterm>
  373. </listitem>
  374. </varlistentry>
  375. <varlistentry id="newgidmap">
  376. <term><command>newgidmap</command></term>
  377. <listitem>
  378. <para>用于设定一个用户命名空间的 gid 映射</para>
  379. <indexterm zone="ch-system-shadow newgidmap">
  380. <primary sortas="b-newgidmap">newgidmap</primary>
  381. </indexterm>
  382. </listitem>
  383. </varlistentry>
  384. <varlistentry id="newgrp">
  385. <term><command>newgrp</command></term>
  386. <listitem>
  387. <para>用于在登录会话中修改当前 GID</para>
  388. <indexterm zone="ch-system-shadow newgrp">
  389. <primary sortas="b-newgrp">newgrp</primary>
  390. </indexterm>
  391. </listitem>
  392. </varlistentry>
  393. <varlistentry id="newuidmap">
  394. <term><command>newuidmap</command></term>
  395. <listitem>
  396. <para>用于设定用户命名空间的 uid 映射</para>
  397. <indexterm zone="ch-system-shadow newuidmap">
  398. <primary sortas="b-newuidmap">newuidmap</primary>
  399. </indexterm>
  400. </listitem>
  401. </varlistentry>
  402. <varlistentry id="newusers">
  403. <term><command>newusers</command></term>
  404. <listitem>
  405. <para>用于批量创建或更新用户账户</para>
  406. <indexterm zone="ch-system-shadow newusers">
  407. <primary sortas="b-newusers">newusers</primary>
  408. </indexterm>
  409. </listitem>
  410. </varlistentry>
  411. <varlistentry id="nologin">
  412. <term><command>nologin</command></term>
  413. <listitem>
  414. <para>显示一条账户不可用的消息,
  415. 它被设计为用来当作被禁用的账户的默认 shell</para>
  416. <indexterm zone="ch-system-shadow nologin">
  417. <primary sortas="b-nologin">nologin</primary>
  418. </indexterm>
  419. </listitem>
  420. </varlistentry>
  421. <varlistentry id="passwd">
  422. <term><command>passwd</command></term>
  423. <listitem>
  424. <para>用于修改用户或组账户的密码</para>
  425. <indexterm zone="ch-system-shadow passwd">
  426. <primary sortas="b-passwd">passwd</primary>
  427. </indexterm>
  428. </listitem>
  429. </varlistentry>
  430. <varlistentry id="pwck">
  431. <term><command>pwck</command></term>
  432. <listitem>
  433. <para>检验密码文件
  434. <filename>/etc/passwd</filename> 和
  435. <filename>/etc/shadow</filename> 的完整性</para>
  436. <indexterm zone="ch-system-shadow pwck">
  437. <primary sortas="b-pwck">pwck</primary>
  438. </indexterm>
  439. </listitem>
  440. </varlistentry>
  441. <varlistentry id="pwconv">
  442. <term><command>pwconv</command></term>
  443. <listitem>
  444. <para>从普通密码文件创建或更新加密密码文件</para>
  445. <indexterm zone="ch-system-shadow pwconv">
  446. <primary sortas="b-pwconv">pwconv</primary>
  447. </indexterm>
  448. </listitem>
  449. </varlistentry>
  450. <varlistentry id="pwunconv">
  451. <term><command>pwunconv</command></term>
  452. <listitem>
  453. <para>根据 <filename>/etc/shadow</filename> 更新
  454. <filename>/etc/shadow</filename> 并删除前者</para>
  455. <indexterm zone="ch-system-shadow pwunconv">
  456. <primary sortas="b-pwunconv">pwunconv</primary>
  457. </indexterm>
  458. </listitem>
  459. </varlistentry>
  460. <varlistentry id="sg">
  461. <term><command>sg</command></term>
  462. <listitem>
  463. <para>在用户 GID 设为给定组 ID 的情况下,执行给定命令</para>
  464. <indexterm zone="ch-system-shadow sg">
  465. <primary sortas="b-sg">sg</primary>
  466. </indexterm>
  467. </listitem>
  468. </varlistentry>
  469. <varlistentry id="su">
  470. <term><command>su</command></term>
  471. <listitem>
  472. <para>用替换的用户和组 ID 运行 shell</para>
  473. <indexterm zone="ch-system-shadow su">
  474. <primary sortas="b-su">su</primary>
  475. </indexterm>
  476. </listitem>
  477. </varlistentry>
  478. <varlistentry id="useradd">
  479. <term><command>useradd</command></term>
  480. <listitem>
  481. <para>以指定名称创建新用户,或更新新用户默认信息</para>
  482. <indexterm zone="ch-system-shadow useradd">
  483. <primary sortas="b-useradd">useradd</primary>
  484. </indexterm>
  485. </listitem>
  486. </varlistentry>
  487. <varlistentry id="userdel">
  488. <term><command>userdel</command></term>
  489. <listitem>
  490. <para>删除给定用户</para>
  491. <indexterm zone="ch-system-shadow userdel">
  492. <primary sortas="b-userdel">userdel</primary>
  493. </indexterm>
  494. </listitem>
  495. </varlistentry>
  496. <varlistentry id="usermod">
  497. <term><command>usermod</command></term>
  498. <listitem>
  499. <para>修改给定用户的登录名称、用户 ID、shell、初始组、
  500. home 目录等信息</para>
  501. <indexterm zone="ch-system-shadow usermod">
  502. <primary sortas="b-usermod">usermod</primary>
  503. </indexterm>
  504. </listitem>
  505. </varlistentry>
  506. <varlistentry id="vigr">
  507. <term><command>vigr</command></term>
  508. <listitem>
  509. <para>编辑 <filename>/etc/group</filename> 或
  510. <filename>/etc/gshadow</filename> 文件</para>
  511. <indexterm zone="ch-system-shadow vigr">
  512. <primary sortas="b-vigr">vigr</primary>
  513. </indexterm>
  514. </listitem>
  515. </varlistentry>
  516. <varlistentry id="vipw">
  517. <term><command>vipw</command></term>
  518. <listitem>
  519. <para>编辑 <filename>/etc/passwd</filename> 或
  520. <filename>/etc/shadow</filename> 文件</para>
  521. <indexterm zone="ch-system-shadow vipw">
  522. <primary sortas="b-vipw">vipw</primary>
  523. </indexterm>
  524. </listitem>
  525. </varlistentry>
  526. </variablelist>
  527. </sect2>
  528. </sect1>