shadow.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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=/lib --enable-shared</userinput></screen>
  28. <para>Compile the package:</para>
  29. <screen><userinput>make</userinput></screen>
  30. <para>Then install it:</para>
  31. <screen><userinput>make install</userinput></screen>
  32. <para>Shadow uses two files to configure authentication settings for the
  33. system. Install these two config files:</para>
  34. <screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
  35. <para>Instead of using the default <emphasis>crypt</emphasis> method, we want
  36. to use the more secure <emphasis>MD5</emphasis> method of password encryption,
  37. which also allows passwords longer than 8 characters. We also need to
  38. change the obsolete <filename class="directory">/var/spool/mail</filename>
  39. location for user mailboxes that Shadow uses by default to the <filename
  40. class="directory">/var/mail</filename> location used currently. We accomplish
  41. both these things by changing the relevant configuration file while copying it
  42. to its destination (it's probably better to cut-and-paste this rather than try
  43. and type it all in):</para>
  44. <screen><userinput>sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
  45. -e 's@/var/spool/mail@/var/mail@' \
  46. &lt; etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
  47. <para>Move some misplaced symlinks/programs to their proper locations:</para>
  48. <screen><userinput>mv /usr/bin/passwd /bin</userinput></screen>
  49. <para>And move Shadow's static library to a more appropriate location:</para>
  50. <screen><userinput>mv /lib/libshadow.*a /usr/lib</userinput></screen>
  51. <para>As some packages expect to find the libraries in
  52. <filename class="directory">/usr/lib</filename>, create the following symlinks:</para>
  53. <screen><userinput>rm /lib/libshadow.so
  54. ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
  55. <para>The <parameter>-D</parameter> option of the <command>useradd</command> program requires this
  56. directory for it to work properly:</para>
  57. <screen><userinput>mkdir /etc/default</userinput></screen>
  58. <para>Coreutils has already installed a better <command>groups</command>
  59. program in <filename class="directory">/usr/bin</filename>. Remove the one
  60. installed by Shadow:</para>
  61. <screen><userinput>rm /bin/groups</userinput></screen>
  62. </sect2>
  63. <sect2 id="conf-shadow" role="configuration"><title>Configuring Shadow</title>
  64. <indexterm zone="conf-shadow">
  65. <primary sortas="a-Shadow">Shadow</primary>
  66. <secondary>configuring</secondary></indexterm>
  67. <para>This package contains utilities to add, modify and delete users and
  68. groups, set and change their passwords, and other such administrative tasks.
  69. For a full explanation of what <emphasis>password shadowing</emphasis> means,
  70. see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
  71. There's one thing to keep in mind if you decide to use Shadow support: programs
  72. that need to verify passwords (display managers, ftp programs, pop3 daemons,
  73. and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
  74. need to be able to work with shadowed passwords.</para>
  75. <para>To enable shadowed passwords, run the following command:</para>
  76. <screen><userinput>pwconv</userinput></screen>
  77. <para>To enable shadowed group passwords, run:</para>
  78. <screen><userinput>grpconv</userinput></screen>
  79. <para>Under normal circumstances, you won't have created any passwords yet.
  80. However, if returning to this section later to enable shadowing, you should
  81. reset any current user passwords with the <command>passwd</command> command or
  82. any group passwords with the <command>gpasswd</command> command.</para>
  83. </sect2>
  84. <sect2 role="configuration">
  85. <title>Setting the root password</title>
  86. <para>Choose a password for user root and set it via:</para>
  87. <screen><userinput>passwd root</userinput></screen>
  88. </sect2>
  89. <sect2 id="contents-shadow" role="content"><title>Contents of Shadow</title>
  90. <segmentedlist>
  91. <segtitle>Installed programs</segtitle>
  92. <seglistitem><seg>chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd,
  93. groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login,
  94. logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg
  95. (link to newgrp), useradd, userdel, usermod, vigr (link to vipw) and vipw</seg>
  96. </seglistitem>
  97. </segmentedlist>
  98. <variablelist><title>Short descriptions</title>
  99. <varlistentry id="chage">
  100. <term><command>chage</command></term>
  101. <listitem>
  102. <indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
  103. <para>is used to change the maximum number of
  104. days between obligatory password changes.</para>
  105. </listitem>
  106. </varlistentry>
  107. <varlistentry id="chfn">
  108. <term><command>chfn</command></term>
  109. <listitem>
  110. <indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
  111. <para>is used to change a user's full name and some other info.</para>
  112. </listitem>
  113. </varlistentry>
  114. <varlistentry id="chpasswd">
  115. <term><command>chpasswd</command></term>
  116. <listitem>
  117. <indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
  118. <para>is used to update the passwords of a
  119. whole series of user accounts in one go.</para>
  120. </listitem>
  121. </varlistentry>
  122. <varlistentry id="chsh">
  123. <term><command>chsh</command></term>
  124. <listitem>
  125. <indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
  126. <para>is used to change a user's default login shell.</para>
  127. </listitem>
  128. </varlistentry>
  129. <varlistentry id="expiry">
  130. <term><command>expiry</command></term>
  131. <listitem>
  132. <indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
  133. <para>checks and enforces the current password expiration policy.</para>
  134. </listitem>
  135. </varlistentry>
  136. <varlistentry id="faillog">
  137. <term><command>faillog</command></term>
  138. <listitem>
  139. <indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
  140. <para>is used to examine the log of login failures, to set a maximum number of
  141. failures before an account is blocked, or to reset the failure count.</para>
  142. </listitem>
  143. </varlistentry>
  144. <varlistentry id="gpasswd">
  145. <term><command>gpasswd</command></term>
  146. <listitem>
  147. <indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
  148. <para>is used to add and delete members and administrators to groups.</para>
  149. </listitem>
  150. </varlistentry>
  151. <varlistentry id="groupadd">
  152. <term><command>groupadd</command></term>
  153. <listitem>
  154. <indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
  155. <para>creates a group with the given name.</para>
  156. </listitem>
  157. </varlistentry>
  158. <varlistentry id="groupdel">
  159. <term><command>groupdel</command></term>
  160. <listitem>
  161. <indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
  162. <para>deletes the group with the given name.</para>
  163. </listitem>
  164. </varlistentry>
  165. <varlistentry id="groupmod">
  166. <term><command>groupmod</command></term>
  167. <listitem>
  168. <indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
  169. <para>is used to modify the given group's name or GID.</para>
  170. </listitem>
  171. </varlistentry>
  172. <varlistentry id="groups">
  173. <term><command>groups</command></term>
  174. <listitem>
  175. <indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
  176. <para>reports the groups of which the given users are members.</para>
  177. </listitem>
  178. </varlistentry>
  179. <varlistentry id="grpck">
  180. <term><command>grpck</command></term>
  181. <listitem>
  182. <indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
  183. <para>verifies the integrity of the group files, <filename>/etc/group</filename>
  184. and <filename>/etc/gshadow</filename>.</para>
  185. </listitem>
  186. </varlistentry>
  187. <varlistentry id="grpconv">
  188. <term><command>grpconv</command></term>
  189. <listitem>
  190. <indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
  191. <para>creates or updates the shadow group file from the normal group file.</para>
  192. </listitem>
  193. </varlistentry>
  194. <varlistentry id="grpunconv">
  195. <term><command>grpunconv</command></term>
  196. <listitem>
  197. <indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
  198. <para>updates <filename>/etc/group</filename>
  199. from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
  200. </listitem>
  201. </varlistentry>
  202. <varlistentry id="lastlog">
  203. <term><command>lastlog</command></term>
  204. <listitem>
  205. <indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
  206. <para>reports the most recent login of all users, or of a given user.</para>
  207. </listitem>
  208. </varlistentry>
  209. <varlistentry id="login">
  210. <term><command>login</command></term>
  211. <listitem>
  212. <indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
  213. <para>is used by the system to let users sign on.</para>
  214. </listitem>
  215. </varlistentry>
  216. <varlistentry id="logoutd">
  217. <term><command>logoutd</command></term>
  218. <listitem>
  219. <indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
  220. <para>is a daemon used to enforce restrictions on log-on time and ports.</para>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry id="mkpasswd">
  224. <term><command>mkpasswd</command></term>
  225. <listitem>
  226. <indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
  227. <para>encrypts the given password using the also given perturbation.</para>
  228. </listitem>
  229. </varlistentry>
  230. <varlistentry id="newgrp">
  231. <term><command>newgrp</command></term>
  232. <listitem>
  233. <indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
  234. <para>is used to change the current GID during a login session.</para>
  235. </listitem>
  236. </varlistentry>
  237. <varlistentry id="newusers">
  238. <term><command>newusers</command></term>
  239. <listitem>
  240. <indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
  241. <para>is used to create or update a whole series of user accounts in one go.</para>
  242. </listitem>
  243. </varlistentry>
  244. <varlistentry id="passwd">
  245. <term><command>passwd</command></term>
  246. <listitem>
  247. <indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
  248. <para>is used to change the password for a user or group account.</para>
  249. </listitem>
  250. </varlistentry>
  251. <varlistentry id="pwck">
  252. <term><command>pwck</command></term>
  253. <listitem>
  254. <indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
  255. <para>verifies the integrity of the password files,
  256. <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
  257. </listitem>
  258. </varlistentry>
  259. <varlistentry id="pwconv">
  260. <term><command>pwconv</command></term>
  261. <listitem>
  262. <indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
  263. <para>creates or updates the shadow password file
  264. from the normal password file.</para>
  265. </listitem>
  266. </varlistentry>
  267. <varlistentry id="pwunconv">
  268. <term><command>pwunconv</command></term>
  269. <listitem>
  270. <indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
  271. <para>updates <filename>/etc/passwd</filename>
  272. from <filename>/etc/shadow</filename> and then deletes the latter.</para>
  273. </listitem>
  274. </varlistentry>
  275. <varlistentry id="sg">
  276. <term><command>sg</command></term>
  277. <listitem>
  278. <indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
  279. <para>executes a given command while the user's GID
  280. is set to that of the given group.</para>
  281. </listitem>
  282. </varlistentry>
  283. <varlistentry id="su">
  284. <term><command>su</command></term>
  285. <listitem>
  286. <indexterm zone="ch-system-shadow su"><primary sortas="b-su">su</primary></indexterm>
  287. <para>runs a shell with substitute user and group IDs.</para>
  288. </listitem>
  289. </varlistentry>
  290. <varlistentry id="useradd">
  291. <term><command>useradd</command></term>
  292. <listitem>
  293. <indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
  294. <para>creates a new user with the given name,
  295. or updates the default new-user information.</para>
  296. </listitem>
  297. </varlistentry>
  298. <varlistentry id="userdel">
  299. <term><command>userdel</command></term>
  300. <listitem>
  301. <indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
  302. <para>deletes the given user account.</para>
  303. </listitem>
  304. </varlistentry>
  305. <varlistentry id="usermod">
  306. <term><command>usermod</command></term>
  307. <listitem>
  308. <indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
  309. <para>is used to modify the given user's login name, UID (User Identification),
  310. shell, initial group, home directory, and the like.</para>
  311. </listitem>
  312. </varlistentry>
  313. <varlistentry id="vigr">
  314. <term><command>vigr</command></term>
  315. <listitem>
  316. <indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
  317. <para>can be used to edit the <filename>/etc/group</filename> or
  318. <filename>/etc/gshadow</filename> files.</para>
  319. </listitem>
  320. </varlistentry>
  321. <varlistentry id="vipw">
  322. <term><command>vipw</command></term>
  323. <listitem>
  324. <indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
  325. <para>can be used to edit the <filename>/etc/passwd</filename> or
  326. <filename>/etc/shadow</filename> files.</para>
  327. </listitem>
  328. </varlistentry>
  329. <varlistentry id="libmisc">
  330. <term><filename class="libraryfile">libmisc</filename></term>
  331. <listitem>
  332. <indexterm zone="ch-system-shadow libmisc"><primary sortas="c-libmisc">libmisc</primary></indexterm>
  333. <para>...</para>
  334. </listitem>
  335. </varlistentry>
  336. <varlistentry id="libshadow">
  337. <term><filename class="libraryfile">libshadow</filename></term>
  338. <listitem>
  339. <indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
  340. <para>contains functions used by most programs in this package.</para>
  341. </listitem>
  342. </varlistentry>
  343. </variablelist>
  344. </sect2>
  345. </sect1>