shadow.xml 15 KB

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