source: BOOK/chroot/common/pwdgroup.xml@ c493a172

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since c493a172 was 0f3854e, checked in by Jim Gifford <clfs@…>, 19 years ago

r1172@server (orig r1170): manuel | 2006-02-12 02:55:57 -0800
Added some nodump attributes.

  • Property mode set to 100644
File size: 4.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-chroot-pwdgroup">
9 <?dbhtml filename="pwdgroup.html"?>
10
11 <title>Creating the passwd, group, and log Files</title>
12
13 <indexterm zone="ch-chroot-pwdgroup">
14 <primary sortas="e-/etc/passwd">/etc/passwd</primary>
15 </indexterm>
16
17 <indexterm zone="ch-chroot-pwdgroup">
18 <primary sortas="e-/etc/group">/etc/group</primary>
19 </indexterm>
20
21 <indexterm zone="ch-chroot-pwdgroup">
22 <primary sortas="e-/var/run/utmp">/var/run/utmp</primary>
23 </indexterm>
24
25 <indexterm zone="ch-chroot-pwdgroup">
26 <primary sortas="e-/var/log/btmp">/var/log/btmp</primary>
27 </indexterm>
28
29 <indexterm zone="ch-chroot-pwdgroup">
30 <primary sortas="e-/var/log/lastlog">/var/log/lastlog</primary>
31 </indexterm>
32
33 <indexterm zone="ch-chroot-pwdgroup">
34 <primary sortas="e-/var/log/wtmp">/var/log/wtmp</primary>
35 </indexterm>
36
37 <para>In order for user <systemitem class="username">root</systemitem> to
38 be able to login and for the name <quote>root</quote> to be recognized,
39 there must be relevant entries in the <filename>/etc/passwd</filename>
40 and <filename>/etc/group</filename> files.</para>
41
42 <para>Create the <filename>/etc/passwd</filename> file by running the
43 following command:</para>
44
45<screen><userinput>cat &gt; /etc/passwd &lt;&lt; "EOF"
46<literal>root::0:0:root:/root:/bin/bash
47bin:x:1:1:bin:/bin:/bin/false
48daemon:x:2:2:daemon:/sbin:/bin/false
49adm:x:3:4:adm:/var/adm:/bin/false
50lp:x:10:18:lp:/var/spool/lp:/bin/false
51mail:x:30:30:mail:/var/spool/mail:/bin/false
52news:x:31:31:news:/var/spool/news:/bin/false
53uucp:x:32:32:uucp:/var/spool/uucp:/bin/false
54operator:x:50:0:operator:/root:/bin/bash
55postmaster:x:51:30:postmaster:/var/spool/mail:/bin/false
56nobody:x:65534:65534:nobody:/:/bin/false</literal>
57EOF</userinput></screen>
58
59 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
60 href="../../boot/common/pwdgroup.xml"
61 xpointer="xpointer(//*[@os='a'])"/>
62
63 <para>Create the <filename>/etc/group</filename> file by running the
64 following command:</para>
65
66<screen><userinput>cat &gt; /etc/group &lt;&lt; "EOF"
67<literal>root::0:root
68bin::1:root,bin,daemon
69daemon::2:root,bin,daemon
70sys::3:root,bin,adm
71adm::4:root,adm,daemon
72kmem::5:
73utmp::6:
74tty::10:
75video::11:root
76console::12:
77disk::13:root,adm
78floppy::14:root
79cdrom::15:
80cdrw::16:
81tape::17:root
82lp::18:lp
83usb::19:
84audio::20:
85dialout::21:root
86mail::30:mail
87news::31:news
88uucp::32:uucp
89users::100:
90nogroup::65533:
91nobody::65534:</literal>
92EOF</userinput></screen>
93
94 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
95 href="../../boot/common/pwdgroup.xml"
96 xpointer="xpointer(//*[@os='b'])"/>
97
98 <para>To remove the <quote>I have no name!</quote> prompt, start a
99 new shell. Since a full Glibc was installed in <xref
100 linkend="chapter-cross-tools"/> and the <filename>/etc/passwd</filename>
101 and <filename>/etc/group</filename> files have been created, user name
102 and group name resolution will now work.</para>
103
104<screen role="nodump"><userinput>exec /tools/bin/bash --login +h</userinput></screen>
105
106 <para>Note the use of the <parameter>+h</parameter> directive. This tells
107 <command>bash</command> not to use its internal path hashing. Without this
108 directive, <command>bash</command> would remember the paths to binaries it
109 has executed. To ensure the use of the newly compiled binaries as soon as
110 they are installed, the <parameter>+h</parameter> directive will be used
111 for the duration of the nexts chapters.</para>
112
113 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
114 href="../../boot/common/pwdgroup.xml"
115 xpointer="xpointer(//*[@os='c'])"/>
116
117<screen><userinput>touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
118chgrp -v utmp /var/run/utmp /var/log/lastlog
119chmod -v 664 /var/run/utmp /var/log/lastlog
120chmod -v 600 /var/log/btmp</userinput></screen>
121
122 <para>The <filename>/var/run/utmp</filename> file records the users that
123 are currently logged in. The <filename>/var/log/wtmp</filename> file records
124 all logins and logouts. The <filename>/var/log/lastlog</filename> file
125 records when each user last logged in. The <filename>/var/log/btmp</filename>
126 file records the bad login attempts.</para>
127
128</sect1>
Note: See TracBrowser for help on using the repository browser.