source: BOOK/boot/common/pwdgroup.xml@ 0b8e180

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

r627@server (orig r625): jim | 2005-10-31 12:59:34 -0800
Import of Cross-LFS Book

  • Property mode set to 100644
File size: 4.5 KB
RevLine 
[3f8be484]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-boot-pwdgroup">
9 <?dbhtml filename="pwdgroup.html"?>
10
11 <title>Creating the passwd, group, and log Files</title>
12
13 <indexterm zone="ch-boot-pwdgroup">
14 <primary sortas="e-${LFS}/etc/passwd">${LFS}/etc/passwd</primary>
15 </indexterm>
16
17 <indexterm zone="ch-boot-pwdgroup">
18 <primary sortas="e-${LFS}/etc/group">${LFS}/etc/group</primary>
19 </indexterm>
20
21 <indexterm zone="ch-boot-pwdgroup">
22 <primary sortas="e-${LFS}/var/run/utmp">${LFS}/var/run/utmp</primary>
23 </indexterm>
24
25 <indexterm zone="ch-boot-pwdgroup">
26 <primary sortas="e-${LFS}/var/log/btmp">${LFS}/var/log/btmp</primary>
27 </indexterm>
28
29 <indexterm zone="ch-boot-pwdgroup">
30 <primary sortas="e-${LFS}/var/log/lastlog">${LFS}/var/log/lastlog</primary>
31 </indexterm>
32
33 <indexterm zone="ch-boot-pwdgroup">
34 <primary sortas="e-${LFS}/var/log/wtmp">${LFS}/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>${LFS}/etc/passwd</filename>
40 and <filename>${LFS}/etc/group</filename> files.</para>
41
42 <para>Create the <filename>${LFS}/etc/passwd</filename> file by running
43 the following command:</para>
44
45<screen><userinput>cat &gt; ${LFS}/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
50sync:x:5:0:sync:/sbin:/bin/sync
51shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
52halt:x:7:0:halt:/sbin:/sbin/halt
53lp:x:10:18:lp:/var/spool/lp:/bin/false
54mail:x:30:30:mail:/var/spool/mail:/bin/false
55news:x:31:31:news:/var/spool/news:/bin/false
56uucp:x:32:32:uucp:/var/spool/uucp:/bin/false
57operator:x:50:0:operator:/root:/bin/bash
58postmaster:x:51:30:postmaster:/var/spool/mail:/bin/false
59nobody:x:65534:65534:nobody:/:/bin/false</literal>
60EOF</userinput></screen>
61
62 <para os="a">The actual password for <systemitem class="username">root</systemitem>
63 (the <quote>x</quote> used here is just a placeholder) will be set
64 later.</para>
65
66 <para>Create the <filename>${LFS}/etc/group</filename> file by running
67 the following command:</para>
68
69<screen><userinput>cat &gt; ${LFS}/etc/group &lt;&lt; "EOF"
70<literal>root::0:root
71bin::1:root,bin,daemon
72daemon::2:root,bin,daemon
73sys::3:root,bin,adm
74adm::4:root,adm,daemon
75kmem::5:
76tty::10:
77video::11:root
78console::12:
79disk::13:root,adm
80floppy::14:root
81cdrom::15:
82cdrw::16:
83tape::17:root
84lp::18:lp
85usb::19:
86audio::20:
87dialout::21:root
88mail::30:mail
89news::31:news
90uucp::32:uucp
91users::100:
92nogroup::65533:
93nobody::65534:</literal>
94EOF</userinput></screen>
95
96 <para os="b">The created groups are not part of any standard&mdash;they are
97 groups decided on in part by the requirements of the Udev configuration
98 in the final system, and in part by common convention employed by a
99 number of existing Linux distributions. The Linux Standard Base (LSB,
100 available at <ulink url="http://www.linuxbase.org"/>) recommends only
101 that, besides the group <quote>root</quote> with a Group ID (GID) of 0,
102 a group <quote>bin</quote> with a GID of 1 be present. All other group
103 names and GIDs can be chosen freely by the system administrator since
104 well-written programs do not depend on GID numbers, but rather use the
105 group's name.</para>
106
107 <para os="c">The <command>login</command>, <command>agetty</command>, and
108 <command>init</command> programs (and others) use a number of log
109 files to record information such as who was logged into the system and
110 when. However, these programs will not write to the log files if they
111 do not already exist. Initialize the log files and give them
112 proper permissions:</para>
113
114<screen><userinput>touch ${LFS}/var/run/utmp ${LFS}/var/log/{btmp,lastlog,wtmp}
115chmod 664 ${LFS}/var/run/utmp ${LFS}/var/log/lastlog
116chmod 600 ${LFS}/var/log/btmp</userinput></screen>
117
118 <para>The <filename>${LFS}/var/run/utmp</filename> file records the users
119 that are currently logged in. The <filename>${LFS}/var/log/wtmp</filename>
120 file records all logins and logouts. The
121 <filename>${LFS}/var/log/lastlog</filename> file records when
122 each user last logged in. The <filename>${LFS}/var/log/btmp</filename> file
123 records the bad login attempts.</para>
124
125</sect1>
Note: See TracBrowser for help on using the repository browser.