shadow.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-shadow" xreflabel="Shadow">
  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. <para>The Shadow package contains programs for handling passwords in a secure
  11. way.</para>
  12. <screen>&buildtime; 0.4 SBU
  13. &diskspace; 11 MB</screen>
  14. <para>Shadow installation depends on: Bash, Binutils, Bison, Coreutils,
  15. Diffutils, GCC, Gettext, Glibc, Grep, Make, Sed.</para>
  16. <sect2>
  17. <title>Installation of Shadow</title>
  18. <para>Shadow hard-wires the path to the <command>passwd</command> binary within
  19. the binary itself, but does this the wrong way. If a <command>passwd</command>
  20. binary is not present before installing Shadow, the package incorrectly assumes
  21. it is going to be located at <filename>/bin/passwd</filename>, but then
  22. installs it as <filename>/usr/bin/passwd</filename>. This will lead to errors
  23. about not finding <filename>/bin/passwd</filename>. To work around this bug,
  24. create a dummy <filename>passwd</filename> file, so that it gets hard-wired
  25. properly:</para>
  26. <screen><userinput>touch /usr/bin/passwd</userinput></screen>
  27. <para>Now prepare Shadow for compilation:</para>
  28. <screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
  29. <para>Work around a problem that prevents Shadow's internationalization from
  30. working:</para>
  31. <screen><userinput>echo '#define HAVE_SETLOCALE 1' &gt;&gt; config.h</userinput></screen>
  32. <para>Shadow incorrectly declares the malloc() function, causing compilation
  33. failure. Fix this:</para>
  34. <screen><userinput>sed -i '/extern char/d' libmisc/xmalloc.c</userinput></screen>
  35. <para>Compile the package:</para>
  36. <screen><userinput>make</userinput></screen>
  37. <para>Then install it:</para>
  38. <screen><userinput>make install</userinput></screen>
  39. <para>Shadow uses two files to configure authentication settings for the
  40. system. Install these two config files:</para>
  41. <screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
  42. <para>Instead of using the default <emphasis>crypt</emphasis> method, we want
  43. to use the more secure <emphasis>MD5</emphasis> method of password encryption,
  44. which also allows passwords longer than 8 characters. We also need to
  45. change the obsolete <filename class="directory">/var/spool/mail</filename>
  46. location for user mailboxes that Shadow uses by default to the <filename
  47. class="directory">/var/mail</filename> location used currently. We accomplish
  48. both these things by changing the relevant configuration file while copying it
  49. to its destination (it's probably better to cut-and-paste this rather than try
  50. and type it all in):</para>
  51. <screen><userinput>sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
  52. -e 's%/var/spool/mail%/var/mail%' \
  53. etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
  54. <para>Move some misplaced symlinks to their proper locations:</para>
  55. <screen><userinput>mv /bin/sg /usr/bin
  56. mv /bin/vigr /usr/sbin</userinput></screen>
  57. <para>And move Shadow's dynamic libraries to a more appropriate location:</para>
  58. <screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
  59. <para>As some packages expect to find the just-moved libraries in
  60. <filename>/usr/lib</filename>, create the following symlinks:</para>
  61. <screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
  62. ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
  63. <para>The -D option of the <filename>useradd</filename> program requires this
  64. directory for it to work properly:</para>
  65. <screen><userinput>mkdir /etc/default</userinput></screen>
  66. <para>Coreutils has already installed a better <command>groups</command>
  67. program in <filename class="directory">/usr/bin</filename>. Remove the one
  68. installed by Shadow:</para>
  69. <screen><userinput>rm /bin/groups</userinput></screen>
  70. </sect2>
  71. <sect2 id="conf-shadow"><title>Configuring Shadow</title>
  72. <indexterm zone="conf-shadow">
  73. <primary sortas="a-Shadow">Shadow</primary>
  74. <secondary>configuring</secondary></indexterm>
  75. <para>This package contains utilities to add, modify and delete users and
  76. groups, set and change their passwords, and other such administrative tasks.
  77. For a full explanation of what <emphasis>password shadowing</emphasis> means,
  78. see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
  79. There's one thing to keep in mind if you decide to use Shadow support: programs
  80. that need to verify passwords (display managers, ftp programs, pop3 daemons,
  81. and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
  82. need to be able to work with shadowed passwords.</para>
  83. <para>To enable shadowed passwords, run the following command:</para>
  84. <screen><userinput>pwconv</userinput></screen>
  85. <para>To enable shadowed group passwords, run:</para>
  86. <screen><userinput>grpconv</userinput></screen>
  87. <para>Under normal circumstances, you won't have created any passwords yet.
  88. However, if returning to this section later to enable shadowing, you should
  89. reset any current user passwords with the <command>passwd</command> command or
  90. any group passwords with the <command>gpasswd</command> command.</para>
  91. </sect2>
  92. <sect2>
  93. <title>Setting the root password</title>
  94. <para>Choose a password for user root and set it via:</para>
  95. <screen><userinput>passwd root</userinput></screen>
  96. </sect2>
  97. <sect2 id="contents-shadow"><title>Contents of Shadow</title>
  98. <para><emphasis>Installed programs</emphasis>: chage, chfn, chpasswd, chsh,
  99. dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, groups, grpck,
  100. grpconv, grpunconv, lastlog, login, logoutd, mkpasswd, newgrp, newusers,
  101. passwd, pwck, pwconv, pwunconv, sg (link to newgrp), useradd, userdel, usermod,
  102. vigr (link to vipw) and vipw</para>
  103. </sect2>
  104. <sect2><title>Short descriptions</title>
  105. <indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
  106. <para id="chage"><command>chage</command> is used to change the maximum number of
  107. days between obligatory password changes.</para>
  108. <indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
  109. <para id="chfn"><command>chfn</command> is used to change a user's full name and
  110. some other info.</para>
  111. <indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
  112. <para id="chpasswd"><command>chpasswd</command> is used to update the passwords of a
  113. whole series of user accounts in one go.</para>
  114. <indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
  115. <para id="chsh"><command>chsh</command> is used to change a user's default
  116. login shell.</para>
  117. <indexterm zone="ch-system-shadow dpasswd"><primary sortas="b-dpasswd">dpasswd</primary></indexterm>
  118. <para id="dpasswd"><command>dpasswd</command> is used to change dial-up passwords for
  119. user login shells.</para>
  120. <indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
  121. <para id="expiry"><command>expiry</command> checks and enforces the current password
  122. expiration policy.</para>
  123. <indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
  124. <para id="faillog"><command>faillog</command> is used to examine the log of login
  125. failures, to set a maximum number of failures before an account is blocked,
  126. or to reset the failure count.</para>
  127. <indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
  128. <para id="gpasswd"><command>gpasswd</command> is used to add and delete members and
  129. administrators to groups.</para>
  130. <indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
  131. <para id="groupadd"><command>groupadd</command> creates a group with the given
  132. name.</para>
  133. <indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
  134. <para id="groupdel"><command>groupdel</command> deletes the group with the given
  135. name.</para>
  136. <indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
  137. <para id="groupmod"><command>groupmod</command> is used to modify the given group's
  138. name or GID.</para>
  139. <indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
  140. <para id="groups"><command>groups</command> reports the groups of which the given
  141. users are members.</para>
  142. <indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
  143. <para id="grpck"><command>grpck</command> verifies the integrity of the group files,
  144. <filename>/etc/group</filename> and <filename>/etc/gshadow</filename>.</para>
  145. <indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
  146. <para id="grpconv"><command>grpconv</command> creates or updates the shadow group file
  147. from the normal group file.</para>
  148. <indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
  149. <para id="grpunconv"><command>grpunconv</command> updates <filename>/etc/group</filename>
  150. from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
  151. <indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
  152. <para id="lastlog"><command>lastlog</command> reports the most recent login of all
  153. users, or of a given user.</para>
  154. <indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
  155. <para id="login"><command>login</command> is used by the system to let users sign on.</para>
  156. <indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
  157. <para id="logoutd"><command>logoutd</command> is a daemon used to enforce restrictions
  158. on log-on time and ports.</para>
  159. <indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
  160. <para id="mkpasswd"><command>mkpasswd</command> encrypts the given password using the
  161. also given perturbation.</para>
  162. <indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
  163. <para id="newgrp"><command>newgrp</command> is used to change the current GID during
  164. a login session.</para>
  165. <indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
  166. <para id="newusers"><command>newusers</command> is used to create or update a whole
  167. series of user accounts in one go.</para>
  168. <indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
  169. <para id="passwd"><command>passwd</command> is used to change the password for a user
  170. or group account.</para>
  171. <indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
  172. <para id="pwck"><command>pwck</command> verifies the integrity of the password files,
  173. <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
  174. <indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
  175. <para id="pwconv"><command>pwconv</command> creates or updates the shadow password file
  176. from the normal password file.</para>
  177. <indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
  178. <para id="pwunconv"><command>pwunconv</command> updates <filename>/etc/passwd</filename>
  179. from <filename>/etc/shadow</filename> and then deletes the latter.</para>
  180. <indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
  181. <para id="sg"><command>sg</command> executes a given command while the user's GID
  182. is set to that of the given group.</para>
  183. <indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
  184. <para id="useradd"><command>useradd</command> creates a new user with the given name,
  185. or updates the default new-user information.</para>
  186. <indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
  187. <para id="userdel"><command>userdel</command> deletes the given user account.</para>
  188. <indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
  189. <para id="usermod"><command>usermod</command> is used to modify the given user's
  190. login name, UID (User Identification), shell, initial group, home directory, and the like.</para>
  191. <indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
  192. <para id="vigr"><command>vigr</command> can be used to edit the
  193. <filename>/etc/group</filename> or <filename>/etc/gshadow</filename>
  194. files.</para>
  195. <indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
  196. <para id="vipw"><command>vipw</command> can be used to edit the
  197. <filename>/etc/passwd</filename> or <filename>/etc/shadow</filename>
  198. files.</para>
  199. <indexterm zone="ch-system-shadow libmisc"><primary sortas="c-libmisc">libmisc</primary></indexterm>
  200. <para id="libmisc"><command>libmisc</command>...</para>
  201. <indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
  202. <para id="libshadow"><command>libshadow</command> contains functions used by most
  203. programs in this package.</para>
  204. </sect2>
  205. </sect1>