shadow.xml 19 KB

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