shadow.xml 20 KB

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