shadow.xml 15 KB

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