shadow.xml 19 KB

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