shadow.xml 20 KB

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