shadow.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-shadow" role="wrap">
  7. <title>Shadow-&shadow-version;</title>
  8. <?dbhtml filename="shadow.html"?>
  9. <indexterm zone="ch-system-shadow"><primary sortas="a-Shadow">Shadow</primary></indexterm>
  10. <sect2 role="package"><title/>
  11. <para>The Shadow package contains programs for handling passwords in a secure
  12. way.</para>
  13. <segmentedlist>
  14. <segtitle>&buildtime;</segtitle>
  15. <segtitle>&diskspace;</segtitle>
  16. <seglistitem><seg>0.3 SBU</seg><seg>15.9 MB</seg></seglistitem>
  17. </segmentedlist>
  18. <segmentedlist>
  19. <segtitle>&dependencies;</segtitle>
  20. <seglistitem><seg>Bash, Binutils, Bison, Coreutils,
  21. Diffutils, GCC, Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem>
  22. </segmentedlist>
  23. </sect2>
  24. <sect2 role="installation">
  25. <title>Installation of Shadow</title>
  26. <note><para>If you would like to enforce the use of strong passwords, refer to
  27. <ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/> for installing Cracklib
  28. prior to building Shadow. Then add <parameter>--with-libcrack</parameter> to the
  29. <command>configure</command> command below.</para></note>
  30. <para>Apply a patch to fix a number of incorrect assumptions in Shadow's
  31. <command>configure</command> script:</para>
  32. <screen><userinput>patch -Np1 -i ../&shadow-configure-patch;</userinput></screen>
  33. <para>Prepare Shadow for compilation:</para>
  34. <screen><userinput>./configure --libdir=/lib --enable-shared</userinput></screen>
  35. <para>Disable the installation of the <command>groups</command> program and its man page, as Coreutils provides a better version:</para>
  36. <screen><userinput>sed -i 's/groups$(EXEEXT) //' src/Makefile
  37. find man -name Makefile -exec sed -i '/groups/d' {} \;</userinput></screen>
  38. <para>Disable the installation of Chinese and Korean manual pages, since Man-DB
  39. cannot format them properly:</para>
  40. <screen><userinput>sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile</userinput></screen>
  41. <para>Compile the package:</para>
  42. <screen><userinput>make</userinput></screen>
  43. <para>This package does not come with a test suite.</para>
  44. <para>Install the package:</para>
  45. <screen><userinput>make install</userinput></screen>
  46. <para id="shadow-limits-login_access">Shadow uses two files to configure
  47. authentication settings for the system. Install these two configuration
  48. files:</para>
  49. <indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/limits">/etc/limits</primary></indexterm>
  50. <indexterm zone="shadow-limits-login_access"><primary sortas="e-/etc/login.access">/etc/login.access</primary></indexterm>
  51. <screen><userinput>cp -v etc/{limits,login.access} /etc</userinput></screen>
  52. <para id="shadow-login_defs">Instead of using the default <emphasis>crypt</emphasis> method,
  53. use the more secure <emphasis>MD5</emphasis> method of password
  54. encryption, which also allows passwords longer than 8 characters. It
  55. is also necessary to change the obsolete <filename
  56. class="directory">/var/spool/mail</filename> location for user
  57. mailboxes that Shadow uses by default to the <filename
  58. class="directory">/var/mail</filename> location used currently. Both
  59. of these can be accomplished by changing the relevant configuration
  60. file while copying it to its destination:</para>
  61. <indexterm zone="shadow-login_defs"><primary sortas="e-/etc/login.defs">/etc/login.defs</primary></indexterm>
  62. <note><para>If you built Shadow with Cracklib support, insert the following into
  63. the <command>sed</command> given below:</para>
  64. <screen><literal>-e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@'</literal></screen>
  65. </note>
  66. <screen><userinput>sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
  67. -e 's@/var/spool/mail@/var/mail@' \
  68. etc/login.defs &gt; /etc/login.defs</userinput></screen>
  69. <para>Move a misplaced program to its proper location:</para>
  70. <screen><userinput>mv -v /usr/bin/passwd /bin</userinput></screen>
  71. <para>Move Shadow's libraries to more appropriate locations:</para>
  72. <screen><userinput>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. <para>The <parameter>-D</parameter> option of the
  76. <command>useradd</command> program requires the <filename
  77. class="directory">/etc/default</filename> directory for it to work
  78. properly:</para>
  79. <screen><userinput>mkdir -v /etc/default</userinput></screen>
  80. </sect2>
  81. <sect2 id="conf-shadow" role="configuration"><title>Configuring Shadow</title>
  82. <indexterm zone="conf-shadow">
  83. <primary sortas="a-Shadow">Shadow</primary>
  84. <secondary>configuring</secondary></indexterm>
  85. <para>This package contains utilities to add, modify, and delete users
  86. and groups; set and change their passwords; and perform other
  87. administrative tasks. For a full explanation of what
  88. <emphasis>password shadowing</emphasis> means, see the
  89. <filename>doc/HOWTO</filename> file within the unpacked source tree.
  90. If using Shadow support, keep in mind that programs which need to
  91. verify passwords (display managers, FTP programs, pop3 daemons, etc.)
  92. must be Shadow-compliant. That is, they need to be able to work with
  93. shadowed passwords.</para>
  94. <para>To enable shadowed passwords, run the following command:</para>
  95. <screen><userinput>pwconv</userinput></screen>
  96. <para>To enable shadowed group passwords, run:</para>
  97. <screen><userinput>grpconv</userinput></screen>
  98. <para>Under normal circumstances, passwords will not have been created
  99. yet. However, if returning to this section later to enable shadowing,
  100. reset any current user passwords with the <command>passwd</command>
  101. command or any group passwords with the <command>gpasswd</command>
  102. command.</para>
  103. </sect2>
  104. <sect2 role="configuration">
  105. <title>Setting the root password</title>
  106. <para>Choose a password for user <emphasis>root</emphasis> and set it
  107. by running:</para>
  108. <screen role="nodump"><userinput>passwd root</userinput></screen>
  109. </sect2>
  110. <sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
  111. <segmentedlist>
  112. <segtitle>Installed programs</segtitle>
  113. <segtitle>Installed libraries</segtitle>
  114. <seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
  115. groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login,
  116. logoutd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg (link to newgrp),
  117. su, useradd, userdel, usermod, vigr (link to vipw), and vipw</seg>
  118. <seg>libshadow.[a,so]</seg>
  119. </seglistitem>
  120. </segmentedlist>
  121. <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
  122. <?dbfo list-presentation="list"?>
  123. <?dbhtml list-presentation="table"?>
  124. <varlistentry id="chage">
  125. <term><command>chage</command></term>
  126. <listitem>
  127. <para>Used to change the maximum number of days between obligatory
  128. password changes</para>
  129. <indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
  130. </listitem>
  131. </varlistentry>
  132. <varlistentry id="chfn">
  133. <term><command>chfn</command></term>
  134. <listitem>
  135. <para>Used to change a user's full name and other information</para>
  136. <indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
  137. </listitem>
  138. </varlistentry>
  139. <varlistentry id="chpasswd">
  140. <term><command>chpasswd</command></term>
  141. <listitem>
  142. <para>Used to update the passwords of an entire series of user
  143. accounts</para>
  144. <indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
  145. </listitem>
  146. </varlistentry>
  147. <varlistentry id="chsh">
  148. <term><command>chsh</command></term>
  149. <listitem>
  150. <para>Used to change a user's default login shell</para>
  151. <indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
  152. </listitem>
  153. </varlistentry>
  154. <varlistentry id="expiry">
  155. <term><command>expiry</command></term>
  156. <listitem>
  157. <para>Checks and enforces the current password expiration policy</para>
  158. <indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
  159. </listitem>
  160. </varlistentry>
  161. <varlistentry id="faillog">
  162. <term><command>faillog</command></term>
  163. <listitem>
  164. <para>Is used to examine the log of login failures, to set a maximum number of
  165. failures before an account is blocked, or to reset the failure count</para>
  166. <indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
  167. </listitem>
  168. </varlistentry>
  169. <varlistentry id="gpasswd">
  170. <term><command>gpasswd</command></term>
  171. <listitem>
  172. <para>Is used to add and delete members and administrators to groups</para>
  173. <indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
  174. </listitem>
  175. </varlistentry>
  176. <varlistentry id="groupadd">
  177. <term><command>groupadd</command></term>
  178. <listitem>
  179. <para>Creates a group with the given name</para>
  180. <indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
  181. </listitem>
  182. </varlistentry>
  183. <varlistentry id="groupdel">
  184. <term><command>groupdel</command></term>
  185. <listitem>
  186. <para>Deletes the group with the given name</para>
  187. <indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
  188. </listitem>
  189. </varlistentry>
  190. <varlistentry id="groupmod">
  191. <term><command>groupmod</command></term>
  192. <listitem>
  193. <para>Is used to modify the given group's name or GID</para>
  194. <indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
  195. </listitem>
  196. </varlistentry>
  197. <varlistentry id="grpck">
  198. <term><command>grpck</command></term>
  199. <listitem>
  200. <para>Verifies the integrity of the group files <filename>/etc/group</filename>
  201. and <filename>/etc/gshadow</filename></para>
  202. <indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
  203. </listitem>
  204. </varlistentry>
  205. <varlistentry id="grpconv">
  206. <term><command>grpconv</command></term>
  207. <listitem>
  208. <para>Creates or updates the shadow group file from the normal group file</para>
  209. <indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
  210. </listitem>
  211. </varlistentry>
  212. <varlistentry id="grpunconv">
  213. <term><command>grpunconv</command></term>
  214. <listitem>
  215. <para>Updates <filename>/etc/group</filename>
  216. from <filename>/etc/gshadow</filename> and then deletes the latter</para>
  217. <indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
  218. </listitem>
  219. </varlistentry>
  220. <varlistentry id="lastlog">
  221. <term><command>lastlog</command></term>
  222. <listitem>
  223. <para>Reports the most recent login of all users or of a given user</para>
  224. <indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
  225. </listitem>
  226. </varlistentry>
  227. <varlistentry id="login">
  228. <term><command>login</command></term>
  229. <listitem>
  230. <para>Is used by the system to let users sign on</para>
  231. <indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
  232. </listitem>
  233. </varlistentry>
  234. <varlistentry id="logoutd">
  235. <term><command>logoutd</command></term>
  236. <listitem>
  237. <para>Is a daemon used to enforce restrictions on log-on time and ports</para>
  238. <indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
  239. </listitem>
  240. </varlistentry>
  241. <varlistentry id="newgrp">
  242. <term><command>newgrp</command></term>
  243. <listitem>
  244. <para>Is used to change the current GID during a login session</para>
  245. <indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
  246. </listitem>
  247. </varlistentry>
  248. <varlistentry id="newusers">
  249. <term><command>newusers</command></term>
  250. <listitem>
  251. <para>Is used to create or update an entire series of user accounts</para>
  252. <indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
  253. </listitem>
  254. </varlistentry>
  255. <varlistentry id="passwd">
  256. <term><command>passwd</command></term>
  257. <listitem>
  258. <para>Is used to change the password for a user or group account</para>
  259. <indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
  260. </listitem>
  261. </varlistentry>
  262. <varlistentry id="pwck">
  263. <term><command>pwck</command></term>
  264. <listitem>
  265. <para>Verifies the integrity of the password files
  266. <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename></para>
  267. <indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
  268. </listitem>
  269. </varlistentry>
  270. <varlistentry id="pwconv">
  271. <term><command>pwconv</command></term>
  272. <listitem>
  273. <para>Creates or updates the shadow password file from the normal
  274. password file</para>
  275. <indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
  276. </listitem>
  277. </varlistentry>
  278. <varlistentry id="pwunconv">
  279. <term><command>pwunconv</command></term>
  280. <listitem>
  281. <para>Updates <filename>/etc/passwd</filename>
  282. from <filename>/etc/shadow</filename> and then deletes the latter</para>
  283. <indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
  284. </listitem>
  285. </varlistentry>
  286. <varlistentry id="sg">
  287. <term><command>sg</command></term>
  288. <listitem>
  289. <para>Executes a given command while the user's GID
  290. is set to that of the given group</para>
  291. <indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
  292. </listitem>
  293. </varlistentry>
  294. <varlistentry id="su">
  295. <term><command>su</command></term>
  296. <listitem>
  297. <indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
  298. <para>Runs a shell with substitute user and group IDs</para>
  299. </listitem>
  300. </varlistentry>
  301. <varlistentry id="useradd">
  302. <term><command>useradd</command></term>
  303. <listitem>
  304. <para>Creates a new user with the given name, or updates the default
  305. new-user information</para>
  306. <indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
  307. </listitem>
  308. </varlistentry>
  309. <varlistentry id="userdel">
  310. <term><command>userdel</command></term>
  311. <listitem>
  312. <para>Deletes the given user account</para>
  313. <indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
  314. </listitem>
  315. </varlistentry>
  316. <varlistentry id="usermod">
  317. <term><command>usermod</command></term>
  318. <listitem>
  319. <para>Is used to modify the given user's login name, User
  320. Identification (UID),
  321. shell, initial group, home directory, etc.</para>
  322. <indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
  323. </listitem>
  324. </varlistentry>
  325. <varlistentry id="vigr">
  326. <term><command>vigr</command></term>
  327. <listitem>
  328. <para>Edits the <filename>/etc/group</filename> or
  329. <filename>/etc/gshadow</filename> files</para>
  330. <indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
  331. </listitem>
  332. </varlistentry>
  333. <varlistentry id="vipw">
  334. <term><command>vipw</command></term>
  335. <listitem>
  336. <para>Edits the <filename>/etc/passwd</filename> or
  337. <filename>/etc/shadow</filename> files</para>
  338. <indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
  339. </listitem>
  340. </varlistentry>
  341. <varlistentry id="libshadow">
  342. <term><filename class="libraryfile">libshadow</filename></term>
  343. <listitem>
  344. <para>Contains functions used by most programs in this package</para>
  345. <indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
  346. </listitem>
  347. </varlistentry>
  348. </variablelist>
  349. </sect2>
  350. </sect1>