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