shadow.xml 19 KB

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