shadow.xml 19 KB

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