shadow.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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" 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.4 SBU</seg><seg>11 MB</seg></seglistitem>
  17. </segmentedlist>
  18. <segmentedlist>
  19. <segtitle>Shadow installation depends on</segtitle>
  20. <seglistitem><seg>Bash, Binutils, Bison, Coreutils,
  21. Diffutils, GCC, Gettext, Glibc, Grep, Make, Sed</seg></seglistitem>
  22. </segmentedlist>
  23. </sect2>
  24. <sect2 role="installation">
  25. <title>Installation of Shadow</title>
  26. <para>Prepare Shadow for compilation:</para>
  27. <screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
  28. <para>Work around a problem that prevents Shadow's internationalization from
  29. working:</para>
  30. <screen><userinput>echo '#define HAVE_SETLOCALE 1' &gt;&gt; config.h</userinput></screen>
  31. <para>Shadow incorrectly declares the malloc() function, causing compilation
  32. failure. Fix this:</para>
  33. <screen><userinput>sed -i '/extern char/d' libmisc/xmalloc.c</userinput></screen>
  34. <para>Compile the package:</para>
  35. <screen><userinput>make</userinput></screen>
  36. <para>Then install it:</para>
  37. <screen><userinput>make install</userinput></screen>
  38. <para>Shadow uses two files to configure authentication settings for the
  39. system. Install these two config files:</para>
  40. <screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
  41. <para>Instead of using the default <emphasis>crypt</emphasis> method, we want
  42. to use the more secure <emphasis>MD5</emphasis> method of password encryption,
  43. which also allows passwords longer than 8 characters. We also need to
  44. change the obsolete <filename class="directory">/var/spool/mail</filename>
  45. location for user mailboxes that Shadow uses by default to the <filename
  46. class="directory">/var/mail</filename> location used currently. We accomplish
  47. both these things by changing the relevant configuration file while copying it
  48. to its destination (it's probably better to cut-and-paste this rather than try
  49. and type it all in):</para>
  50. <screen><userinput>cp etc/login.defs.linux /etc/login.defs
  51. sed -i -e 's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
  52. -e 's@/var/spool/mail@/var/mail@' /etc/login.defs</userinput></screen>
  53. <para>Move some misplaced symlinks/programs to their proper locations:</para>
  54. <screen><userinput>mv /bin/sg /usr/bin
  55. mv /bin/vigr /usr/sbin
  56. mv /usr/bin/passwd /bin</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 class="directory">/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 <parameter>-D</parameter> option of the <command>useradd</command> 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" role="configuration"><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 role="configuration">
  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" role="content"><title>Contents of Shadow</title>
  98. <segmentedlist>
  99. <segtitle>Installed programs</segtitle>
  100. <seglistitem><seg>chage, chfn, chpasswd, chsh, dpasswd, expiry, faillog,
  101. gpasswd, groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv,
  102. lastlog, login, logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv,
  103. pwunconv, sg (link to newgrp), useradd, userdel, usermod, vigr (link to vipw) and
  104. vipw</seg></seglistitem>
  105. </segmentedlist>
  106. <variablelist><title>Short descriptions</title>
  107. <varlistentry id="chage">
  108. <term><command>chage</command></term>
  109. <listitem>
  110. <indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
  111. <para>is used to change the maximum number of
  112. days between obligatory password changes.</para>
  113. </listitem>
  114. </varlistentry>
  115. <varlistentry id="chfn">
  116. <term><command>chfn</command></term>
  117. <listitem>
  118. <indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
  119. <para>is used to change a user's full name and some other info.</para>
  120. </listitem>
  121. </varlistentry>
  122. <varlistentry id="chpasswd">
  123. <term><command>chpasswd</command></term>
  124. <listitem>
  125. <indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
  126. <para>is used to update the passwords of a
  127. whole series of user accounts in one go.</para>
  128. </listitem>
  129. </varlistentry>
  130. <varlistentry id="chsh">
  131. <term><command>chsh</command></term>
  132. <listitem>
  133. <indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
  134. <para>is used to change a user's default login shell.</para>
  135. </listitem>
  136. </varlistentry>
  137. <varlistentry id="dpasswd">
  138. <term><command>dpasswd</command></term>
  139. <listitem>
  140. <indexterm zone="ch-system-shadow dpasswd"><primary sortas="b-dpasswd">dpasswd</primary></indexterm>
  141. <para>is used to change dial-up passwords for user login shells.</para>
  142. </listitem>
  143. </varlistentry>
  144. <varlistentry id="expiry">
  145. <term><command>expiry</command></term>
  146. <listitem>
  147. <indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
  148. <para>checks and enforces the current password expiration policy.</para>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry id="faillog">
  152. <term><command>faillog</command></term>
  153. <listitem>
  154. <indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
  155. <para>is used to examine the log of login failures, to set a maximum number of
  156. failures before an account is blocked, or to reset the failure count.</para>
  157. </listitem>
  158. </varlistentry>
  159. <varlistentry id="gpasswd">
  160. <term><command>gpasswd</command></term>
  161. <listitem>
  162. <indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
  163. <para>is used to add and delete members and administrators to groups.</para>
  164. </listitem>
  165. </varlistentry>
  166. <varlistentry id="groupadd">
  167. <term><command>groupadd</command></term>
  168. <listitem>
  169. <indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
  170. <para>creates a group with the given name.</para>
  171. </listitem>
  172. </varlistentry>
  173. <varlistentry id="groupdel">
  174. <term><command>groupdel</command></term>
  175. <listitem>
  176. <indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
  177. <para>deletes the group with the given name.</para>
  178. </listitem>
  179. </varlistentry>
  180. <varlistentry id="groupmod">
  181. <term><command>groupmod</command></term>
  182. <listitem>
  183. <indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
  184. <para>is used to modify the given group's name or GID.</para>
  185. </listitem>
  186. </varlistentry>
  187. <varlistentry id="groups">
  188. <term><command>groups</command></term>
  189. <listitem>
  190. <indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
  191. <para>reports the groups of which the given users are members.</para>
  192. </listitem>
  193. </varlistentry>
  194. <varlistentry id="grpck">
  195. <term><command>grpck</command></term>
  196. <listitem>
  197. <indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
  198. <para>verifies the integrity of the group files, <filename>/etc/group</filename>
  199. and <filename>/etc/gshadow</filename>.</para>
  200. </listitem>
  201. </varlistentry>
  202. <varlistentry id="grpconv">
  203. <term><command>grpconv</command></term>
  204. <listitem>
  205. <indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
  206. <para>creates or updates the shadow group file from the normal group file.</para>
  207. </listitem>
  208. </varlistentry>
  209. <varlistentry id="grpunconv">
  210. <term><command>grpunconv</command></term>
  211. <listitem>
  212. <indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
  213. <para>updates <filename>/etc/group</filename>
  214. from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
  215. </listitem>
  216. </varlistentry>
  217. <varlistentry id="lastlog">
  218. <term><command>lastlog</command></term>
  219. <listitem>
  220. <indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
  221. <para>reports the most recent login of all users, or of a given user.</para>
  222. </listitem>
  223. </varlistentry>
  224. <varlistentry id="login">
  225. <term><command>login</command></term>
  226. <listitem>
  227. <indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
  228. <para>is used by the system to let users sign on.</para>
  229. </listitem>
  230. </varlistentry>
  231. <varlistentry id="logoutd">
  232. <term><command>logoutd</command></term>
  233. <listitem>
  234. <indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
  235. <para>is a daemon used to enforce restrictions on log-on time and ports.</para>
  236. </listitem>
  237. </varlistentry>
  238. <varlistentry id="mkpasswd">
  239. <term><command>mkpasswd</command></term>
  240. <listitem>
  241. <indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
  242. <para>encrypts the given password using the also given perturbation.</para>
  243. </listitem>
  244. </varlistentry>
  245. <varlistentry id="newgrp">
  246. <term><command>newgrp</command></term>
  247. <listitem>
  248. <indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
  249. <para>is used to change the current GID during a login session.</para>
  250. </listitem>
  251. </varlistentry>
  252. <varlistentry id="newusers">
  253. <term><command>newusers</command></term>
  254. <listitem>
  255. <indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
  256. <para>is used to create or update a whole series of user accounts in one go.</para>
  257. </listitem>
  258. </varlistentry>
  259. <varlistentry id="passwd">
  260. <term><command>passwd</command></term>
  261. <listitem>
  262. <indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
  263. <para>is used to change the password for a user or group account.</para>
  264. </listitem>
  265. </varlistentry>
  266. <varlistentry id="pwck">
  267. <term><command>pwck</command></term>
  268. <listitem>
  269. <indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
  270. <para>verifies the integrity of the password files,
  271. <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
  272. </listitem>
  273. </varlistentry>
  274. <varlistentry id="pwconv">
  275. <term><command>pwconv</command></term>
  276. <listitem>
  277. <indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
  278. <para>creates or updates the shadow password file
  279. from the normal password file.</para>
  280. </listitem>
  281. </varlistentry>
  282. <varlistentry id="pwunconv">
  283. <term><command>pwunconv</command></term>
  284. <listitem>
  285. <indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
  286. <para>updates <filename>/etc/passwd</filename>
  287. from <filename>/etc/shadow</filename> and then deletes the latter.</para>
  288. </listitem>
  289. </varlistentry>
  290. <varlistentry id="sg">
  291. <term><command>sg</command></term>
  292. <listitem>
  293. <indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
  294. <para>executes a given command while the user's GID
  295. is set to that of the given group.</para>
  296. </listitem>
  297. </varlistentry>
  298. <varlistentry id="useradd">
  299. <term><command>useradd</command></term>
  300. <listitem>
  301. <indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
  302. <para>creates a new user with the given name,
  303. or updates the default new-user information.</para>
  304. </listitem>
  305. </varlistentry>
  306. <varlistentry id="userdel">
  307. <term><command>userdel</command></term>
  308. <listitem>
  309. <indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
  310. <para>deletes the given user account.</para>
  311. </listitem>
  312. </varlistentry>
  313. <varlistentry id="usermod">
  314. <term><command>usermod</command></term>
  315. <listitem>
  316. <indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
  317. <para>is used to modify the given user's login name, UID (User Identification),
  318. shell, initial group, home directory, and the like.</para>
  319. </listitem>
  320. </varlistentry>
  321. <varlistentry id="vigr">
  322. <term><command>vigr</command></term>
  323. <listitem>
  324. <indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
  325. <para>can be used to edit the <filename>/etc/group</filename> or
  326. <filename>/etc/gshadow</filename> files.</para>
  327. </listitem>
  328. </varlistentry>
  329. <varlistentry id="vipw">
  330. <term><command>vipw</command></term>
  331. <listitem>
  332. <indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
  333. <para>can be used to edit the <filename>/etc/passwd</filename> or
  334. <filename>/etc/shadow</filename> files.</para>
  335. </listitem>
  336. </varlistentry>
  337. <varlistentry id="libmisc">
  338. <term><filename class="libraryfile">libmisc</filename></term>
  339. <listitem>
  340. <indexterm zone="ch-system-shadow libmisc"><primary sortas="c-libmisc">libmisc</primary></indexterm>
  341. <para>...</para>
  342. </listitem>
  343. </varlistentry>
  344. <varlistentry id="libshadow">
  345. <term><filename class="libraryfile">libshadow</filename></term>
  346. <listitem>
  347. <indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
  348. <para>contains functions used by most programs in this package.</para>
  349. </listitem>
  350. </varlistentry>
  351. </variablelist>
  352. </sect2>
  353. </sect1>