shadow.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  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>The Shadow package contains programs for handling passwords in a secure
  21. way.</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&shadow-ch6-sbu;</seg>
  27. <seg>&shadow-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Shadow</title>
  33. <note>
  34. <para>If you would like to enforce the use of strong passwords, refer to
  35. <ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/> for installing
  36. CrackLib prior to building Shadow. Then add
  37. <parameter>--with-libcrack</parameter> to the <command>configure</command>
  38. command below.</para>
  39. </note>
  40. <!-- <para>Fix a bug in the <command>useradd</command> and
  41. <command>usermod</command> programs which prevent them from accepting group
  42. names rather than group ID numbers to the <option>-g</option> option:</para>
  43. <screen><userinput remap="pre">patch -Np1 -i ../&shadow-useradd-patch;</userinput></screen>
  44. -->
  45. <para>Disable the installation of the <command>groups</command> program
  46. and its man pages, as Coreutils provides a better version:</para>
  47. <screen><userinput remap="configure">sed -i 's/groups$(EXEEXT) //' src/Makefile.in
  48. find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;</userinput></screen>
  49. <para>Disable the installation of Chinese and Korean manual pages, since
  50. Man-DB cannot format them properly:</para>
  51. <screen><userinput remap="configure">sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile.in</userinput></screen>
  52. <para>Shadow supplies other manual pages in a UTF-8 encoding. Man-DB
  53. can display these in the recommended encodings by using the
  54. <command>convert-mans</command> script which was installed during the
  55. Man-DB package:</para>
  56. <screen><userinput remap="configure">for i in de es fi fr id it pt_BR; do
  57. convert-mans UTF-8 ISO-8859-1 man/${i}/*.?
  58. done
  59. for i in cs hu pl; do
  60. convert-mans UTF-8 ISO-8859-2 man/${i}/*.?
  61. done
  62. convert-mans UTF-8 EUC-JP man/ja/*.?
  63. convert-mans UTF-8 KOI8-R man/ru/*.?
  64. convert-mans UTF-8 ISO-8859-9 man/tr/*.?</userinput></screen>
  65. <para id="shadow-login_defs">Instead of using the default
  66. <emphasis>crypt</emphasis> method, use the more secure
  67. <emphasis>MD5</emphasis> method of password encryption, which also allows
  68. passwords longer than 8 characters. It is also necessary to change the
  69. obsolete <filename class="directory">/var/spool/mail</filename> location
  70. for user mailboxes that Shadow uses by default to the <filename
  71. class="directory">/var/mail</filename> location used currently:</para>
  72. <screen><userinput remap="configure">sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD MD5@' \
  73. -e 's@/var/spool/mail@/var/mail@' etc/login.defs</userinput></screen>
  74. <note>
  75. <para>If you chose to build Shadow with Cracklib support, run the following:</para>
  76. <screen role="nodump"><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
  77. etc/login.defs</userinput></screen>
  78. </note>
  79. <para>Prepare Shadow for compilation:</para>
  80. <!-- Keeping this in case we revert to an older version
  81. <screen><userinput remap="configure">./configure -libdir=/lib -sysconfdir=/etc -enable-shared \
  82. -without-selinux</userinput></screen>
  83. -->
  84. <screen><userinput remap="configure">./configure --sysconfdir=/etc</userinput></screen>
  85. <!-- <variablelist>
  86. <title>The meaning of the configure options:</title>
  87. <varlistentry>
  88. <term><parameter>-without-selinux</parameter></term>
  89. <listitem>
  90. <para>Support for selinux is enabled by default, but selinux is not
  91. built in a base LFS system. The <command>configure</command> script
  92. will fail if this option is not used.</para>
  93. </listitem>
  94. </varlistentry>
  95. </variablelist> -->
  96. <para>Compile the package:</para>
  97. <screen><userinput remap="make">make</userinput></screen>
  98. <para>This package does not come with a test suite.</para>
  99. <para>Install the package:</para>
  100. <screen><userinput remap="install">make install</userinput></screen>
  101. <para>Move a misplaced program to its proper location:</para>
  102. <screen><userinput remap="install">mv -v /usr/bin/passwd /bin</userinput></screen>
  103. <!-- <para>Move Shadow's libraries to more appropriate locations:</para>
  104. <screen><userinput remap="install">mv -v /lib/libshadow.*a /usr/lib
  105. rm -v /lib/libshadow.so
  106. ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
  107. </sect2>
  108. <sect2 id="conf-shadow" role="configuration">
  109. <title>Configuring Shadow</title>
  110. <indexterm zone="conf-shadow">
  111. <primary sortas="a-Shadow">Shadow</primary>
  112. <secondary>configuring</secondary>
  113. </indexterm>
  114. <para>This package contains utilities to add, modify, and delete users and
  115. groups; set and change their passwords; and perform other administrative
  116. tasks. For a full explanation of what <emphasis>password shadowing</emphasis>
  117. means, see the <filename>doc/HOWTO</filename> file within the unpacked
  118. source tree. If using Shadow support, keep in mind that programs which need
  119. to verify passwords (display managers, FTP programs, pop3 daemons, etc.)
  120. must be Shadow-compliant. That is, they need to be able to work with
  121. shadowed passwords.</para>
  122. <para>To enable shadowed passwords, run the following command:</para>
  123. <screen><userinput>pwconv</userinput></screen>
  124. <para>To enable shadowed group passwords, run:</para>
  125. <screen><userinput>grpconv</userinput></screen>
  126. <para>Shadow's stock configuration for the <command>useradd</command>
  127. utility has a few caveats that need some explanation. First, the default
  128. action for the <command>useradd</command> utility is to create the user and
  129. a group of the same name as the user. By default the user ID (UID) and
  130. group ID (GID) numbers will begin with 1000. This means if you don't pass
  131. parameters to <command>useradd</command>, each user will be a member of a
  132. unique group on the system. If this behaviour is undesireable, you'll need
  133. to pass the <parameter>-g</parameter> parameter to
  134. <command>useradd</command>. The default parameters are stored in the
  135. <filename>/etc/default/useradd</filename> file. You may need to modify two
  136. parameters in this file to suit your particular needs.</para>
  137. <variablelist>
  138. <title><filename>/etc/default/useradd</filename> Parameter Explanations</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. </listitem>
  153. </varlistentry>
  154. <varlistentry>
  155. <term><parameter>CREATE_MAIL_SPOOL=yes</parameter></term>
  156. <listitem>
  157. <para>This parameter causes <command>useradd</command> to create a
  158. mailbox file for the newly created user. <command>useradd</command>
  159. will make the group ownership of this file to the
  160. <systemitem class="groupname">mail</systemitem> group with 0660
  161. permissions. If you would prefer that these mailbox files are not
  162. created by <command>useradd</command>, issue the following
  163. command:</para>
  164. <screen><userinput>sed -i 's/yes/no/' /etc/default/useradd</userinput></screen>
  165. </listitem>
  166. </varlistentry>
  167. </variablelist>
  168. </sect2>
  169. <sect2 role="configuration">
  170. <title>Setting the root password</title>
  171. <para>Choose a password for user <emphasis>root</emphasis> and set it
  172. by running:</para>
  173. <screen role="nodump"><userinput>passwd root</userinput></screen>
  174. </sect2>
  175. <sect2 id="contents-shadow" role="content">
  176. <title>Contents of Shadow</title>
  177. <segmentedlist>
  178. <segtitle>Installed programs</segtitle>
  179. <seglistitem>
  180. <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd,
  181. groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv,
  182. lastlog, login, logoutd, newgrp, newusers, nologin, passwd, pwck,
  183. pwconv, pwunconv, sg (link to newgrp), su, useradd, userdel, usermod,
  184. vigr (link to vipw), and vipw</seg>
  185. </seglistitem>
  186. </segmentedlist>
  187. <variablelist>
  188. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  189. <?dbfo list-presentation="list"?>
  190. <?dbhtml list-presentation="table"?>
  191. <varlistentry id="chage">
  192. <term><command>chage</command></term>
  193. <listitem>
  194. <para>Used to change the maximum number of days between obligatory
  195. password changes</para>
  196. <indexterm zone="ch-system-shadow chage">
  197. <primary sortas="b-chage">chage</primary>
  198. </indexterm>
  199. </listitem>
  200. </varlistentry>
  201. <varlistentry id="chfn">
  202. <term><command>chfn</command></term>
  203. <listitem>
  204. <para>Used to change a user's full name and other information</para>
  205. <indexterm zone="ch-system-shadow chfn">
  206. <primary sortas="b-chfn">chfn</primary>
  207. </indexterm>
  208. </listitem>
  209. </varlistentry>
  210. <varlistentry id="chgpasswd">
  211. <term><command>chgpasswd</command></term>
  212. <listitem>
  213. <para>Used to update group passwords in batch mode</para>
  214. <indexterm zone="ch-system-shadow chgpasswd">
  215. <primary sortas="b-chgpasswd">chgpasswd</primary>
  216. </indexterm>
  217. </listitem>
  218. </varlistentry>
  219. <varlistentry id="chpasswd">
  220. <term><command>chpasswd</command></term>
  221. <listitem>
  222. <para>Used to update user passwords in batch mode</para>
  223. <indexterm zone="ch-system-shadow chpasswd">
  224. <primary sortas="b-chpasswd">chpasswd</primary>
  225. </indexterm>
  226. </listitem>
  227. </varlistentry>
  228. <varlistentry id="chsh">
  229. <term><command>chsh</command></term>
  230. <listitem>
  231. <para>Used to change a user's default login shell</para>
  232. <indexterm zone="ch-system-shadow chsh">
  233. <primary sortas="b-chsh">chsh</primary>
  234. </indexterm>
  235. </listitem>
  236. </varlistentry>
  237. <varlistentry id="expiry">
  238. <term><command>expiry</command></term>
  239. <listitem>
  240. <para>Checks and enforces the current password expiration policy</para>
  241. <indexterm zone="ch-system-shadow expiry">
  242. <primary sortas="b-expiry">expiry</primary>
  243. </indexterm>
  244. </listitem>
  245. </varlistentry>
  246. <varlistentry id="faillog">
  247. <term><command>faillog</command></term>
  248. <listitem>
  249. <para>Is used to examine the log of login failures, to set a maximum
  250. number of failures before an account is blocked, or to reset the
  251. failure count</para>
  252. <indexterm zone="ch-system-shadow faillog">
  253. <primary sortas="b-faillog">faillog</primary>
  254. </indexterm>
  255. </listitem>
  256. </varlistentry>
  257. <varlistentry id="gpasswd">
  258. <term><command>gpasswd</command></term>
  259. <listitem>
  260. <para>Is used to add and delete members and administrators to
  261. groups</para>
  262. <indexterm zone="ch-system-shadow gpasswd">
  263. <primary sortas="b-gpasswd">gpasswd</primary>
  264. </indexterm>
  265. </listitem>
  266. </varlistentry>
  267. <varlistentry id="groupadd">
  268. <term><command>groupadd</command></term>
  269. <listitem>
  270. <para>Creates a group with the given name</para>
  271. <indexterm zone="ch-system-shadow groupadd">
  272. <primary sortas="b-groupadd">groupadd</primary>
  273. </indexterm>
  274. </listitem>
  275. </varlistentry>
  276. <varlistentry id="groupdel">
  277. <term><command>groupdel</command></term>
  278. <listitem>
  279. <para>Deletes the group with the given name</para>
  280. <indexterm zone="ch-system-shadow groupdel">
  281. <primary sortas="b-groupdel">groupdel</primary>
  282. </indexterm>
  283. </listitem>
  284. </varlistentry>
  285. <varlistentry id="groupmems">
  286. <term><command>groupmems</command></term>
  287. <listitem>
  288. <para>Allows a user to administer his/her own group membership list
  289. without the requirement of super user privileges.</para>
  290. <indexterm zone="ch-system-shadow groupmems">
  291. <primary sortas="b-groupmems">groupmems</primary>
  292. </indexterm>
  293. </listitem>
  294. </varlistentry>
  295. <varlistentry id="groupmod">
  296. <term><command>groupmod</command></term>
  297. <listitem>
  298. <para>Is used to modify the given group's name or GID</para>
  299. <indexterm zone="ch-system-shadow groupmod">
  300. <primary sortas="b-groupmod">groupmod</primary>
  301. </indexterm>
  302. </listitem>
  303. </varlistentry>
  304. <varlistentry id="grpck">
  305. <term><command>grpck</command></term>
  306. <listitem>
  307. <para>Verifies the integrity of the group files
  308. <filename>/etc/group</filename> and
  309. <filename>/etc/gshadow</filename></para>
  310. <indexterm zone="ch-system-shadow grpck">
  311. <primary sortas="b-grpck">grpck</primary>
  312. </indexterm>
  313. </listitem>
  314. </varlistentry>
  315. <varlistentry id="grpconv">
  316. <term><command>grpconv</command></term>
  317. <listitem>
  318. <para>Creates or updates the shadow group file from the normal
  319. group file</para>
  320. <indexterm zone="ch-system-shadow grpconv">
  321. <primary sortas="b-grpconv">grpconv</primary>
  322. </indexterm>
  323. </listitem>
  324. </varlistentry>
  325. <varlistentry id="grpunconv">
  326. <term><command>grpunconv</command></term>
  327. <listitem>
  328. <para>Updates <filename>/etc/group</filename> from
  329. <filename>/etc/gshadow</filename> and then deletes the latter</para>
  330. <indexterm zone="ch-system-shadow grpunconv">
  331. <primary sortas="b-grpunconv">grpunconv</primary>
  332. </indexterm>
  333. </listitem>
  334. </varlistentry>
  335. <varlistentry id="lastlog">
  336. <term><command>lastlog</command></term>
  337. <listitem>
  338. <para>Reports the most recent login of all users or of a
  339. given user</para>
  340. <indexterm zone="ch-system-shadow lastlog">
  341. <primary sortas="b-lastlog">lastlog</primary>
  342. </indexterm>
  343. </listitem>
  344. </varlistentry>
  345. <varlistentry id="login">
  346. <term><command>login</command></term>
  347. <listitem>
  348. <para>Is used by the system to let users sign on</para>
  349. <indexterm zone="ch-system-shadow login">
  350. <primary sortas="b-login">login</primary>
  351. </indexterm>
  352. </listitem>
  353. </varlistentry>
  354. <varlistentry id="logoutd">
  355. <term><command>logoutd</command></term>
  356. <listitem>
  357. <para>Is a daemon used to enforce restrictions on log-on time
  358. and ports</para>
  359. <indexterm zone="ch-system-shadow logoutd">
  360. <primary sortas="b-logoutd">logoutd</primary>
  361. </indexterm>
  362. </listitem>
  363. </varlistentry>
  364. <varlistentry id="newgrp">
  365. <term><command>newgrp</command></term>
  366. <listitem>
  367. <para>Is used to change the current GID during a login session</para>
  368. <indexterm zone="ch-system-shadow newgrp">
  369. <primary sortas="b-newgrp">newgrp</primary>
  370. </indexterm>
  371. </listitem>
  372. </varlistentry>
  373. <varlistentry id="newusers">
  374. <term><command>newusers</command></term>
  375. <listitem>
  376. <para>Is used to create or update an entire series of user
  377. accounts</para>
  378. <indexterm zone="ch-system-shadow newusers">
  379. <primary sortas="b-newusers">newusers</primary>
  380. </indexterm>
  381. </listitem>
  382. </varlistentry>
  383. <varlistentry id="nologin">
  384. <term><command>nologin</command></term>
  385. <listitem>
  386. <para>Displays a message that an account is not available. Designed
  387. to be used as the default shell for accounts that have been
  388. disabled</para>
  389. <indexterm zone="ch-system-shadow nologin">
  390. <primary sortas="b-nologin">nologin</primary>
  391. </indexterm>
  392. </listitem>
  393. </varlistentry>
  394. <varlistentry id="passwd">
  395. <term><command>passwd</command></term>
  396. <listitem>
  397. <para>Is used to change the password for a user or group account</para>
  398. <indexterm zone="ch-system-shadow passwd">
  399. <primary sortas="b-passwd">passwd</primary>
  400. </indexterm>
  401. </listitem>
  402. </varlistentry>
  403. <varlistentry id="pwck">
  404. <term><command>pwck</command></term>
  405. <listitem>
  406. <para>Verifies the integrity of the password files
  407. <filename>/etc/passwd</filename> and
  408. <filename>/etc/shadow</filename></para>
  409. <indexterm zone="ch-system-shadow pwck">
  410. <primary sortas="b-pwck">pwck</primary>
  411. </indexterm>
  412. </listitem>
  413. </varlistentry>
  414. <varlistentry id="pwconv">
  415. <term><command>pwconv</command></term>
  416. <listitem>
  417. <para>Creates or updates the shadow password file from the normal
  418. password file</para>
  419. <indexterm zone="ch-system-shadow pwconv">
  420. <primary sortas="b-pwconv">pwconv</primary>
  421. </indexterm>
  422. </listitem>
  423. </varlistentry>
  424. <varlistentry id="pwunconv">
  425. <term><command>pwunconv</command></term>
  426. <listitem>
  427. <para>Updates <filename>/etc/passwd</filename> from
  428. <filename>/etc/shadow</filename> and then deletes the latter</para>
  429. <indexterm zone="ch-system-shadow pwunconv">
  430. <primary sortas="b-pwunconv">pwunconv</primary>
  431. </indexterm>
  432. </listitem>
  433. </varlistentry>
  434. <varlistentry id="sg">
  435. <term><command>sg</command></term>
  436. <listitem>
  437. <para>Executes a given command while the user's GID
  438. is set to that of the given group</para>
  439. <indexterm zone="ch-system-shadow sg">
  440. <primary sortas="b-sg">sg</primary>
  441. </indexterm>
  442. </listitem>
  443. </varlistentry>
  444. <varlistentry id="su">
  445. <term><command>su</command></term>
  446. <listitem>
  447. <para>Runs a shell with substitute user and group IDs</para>
  448. <indexterm zone="ch-system-shadow su">
  449. <primary sortas="b-su">su</primary>
  450. </indexterm>
  451. </listitem>
  452. </varlistentry>
  453. <varlistentry id="useradd">
  454. <term><command>useradd</command></term>
  455. <listitem>
  456. <para>Creates a new user with the given name, or updates the default
  457. new-user information</para>
  458. <indexterm zone="ch-system-shadow useradd">
  459. <primary sortas="b-useradd">useradd</primary>
  460. </indexterm>
  461. </listitem>
  462. </varlistentry>
  463. <varlistentry id="userdel">
  464. <term><command>userdel</command></term>
  465. <listitem>
  466. <para>Deletes the given user account</para>
  467. <indexterm zone="ch-system-shadow userdel">
  468. <primary sortas="b-userdel">userdel</primary>
  469. </indexterm>
  470. </listitem>
  471. </varlistentry>
  472. <varlistentry id="usermod">
  473. <term><command>usermod</command></term>
  474. <listitem>
  475. <para>Is used to modify the given user's login name, User
  476. Identification (UID), shell, initial group, home directory, etc.</para>
  477. <indexterm zone="ch-system-shadow usermod">
  478. <primary sortas="b-usermod">usermod</primary>
  479. </indexterm>
  480. </listitem>
  481. </varlistentry>
  482. <varlistentry id="vigr">
  483. <term><command>vigr</command></term>
  484. <listitem>
  485. <para>Edits the <filename>/etc/group</filename> or
  486. <filename>/etc/gshadow</filename> files</para>
  487. <indexterm zone="ch-system-shadow vigr">
  488. <primary sortas="b-vigr">vigr</primary>
  489. </indexterm>
  490. </listitem>
  491. </varlistentry>
  492. <varlistentry id="vipw">
  493. <term><command>vipw</command></term>
  494. <listitem>
  495. <para>Edits the <filename>/etc/passwd</filename> or
  496. <filename>/etc/shadow</filename> files</para>
  497. <indexterm zone="ch-system-shadow vipw">
  498. <primary sortas="b-vipw">vipw</primary>
  499. </indexterm>
  500. </listitem>
  501. </varlistentry>
  502. </variablelist>
  503. </sect2>
  504. </sect1>