1 | <sect1 id="ch06-pwdgroup">
|
---|
2 | <title>Creating the passwd and group files</title>
|
---|
3 | <?dbhtml filename="pwdgroup.html" dir="chapter06"?>
|
---|
4 |
|
---|
5 | <para>In order for <emphasis>root</emphasis> to be able to login and for the
|
---|
6 | name "root" to be recognized, there need to be relevant entries in the
|
---|
7 | <filename>/etc/passwd</filename> and <filename>/etc/group</filename> files.</para>
|
---|
8 |
|
---|
9 | <para>Create the <filename>/etc/passwd</filename> file by running the following
|
---|
10 | command:</para>
|
---|
11 |
|
---|
12 | <screen><userinput>cat > /etc/passwd << "EOF"</userinput>
|
---|
13 | root:x:0:0:root:/root:/bin/bash
|
---|
14 | <userinput>EOF</userinput></screen>
|
---|
15 |
|
---|
16 | <para>The actual password for <emphasis>root</emphasis> (the "x" here is just a
|
---|
17 | placeholder) will be set later.</para>
|
---|
18 |
|
---|
19 | <para>Create the <filename>/etc/group</filename> file by running the following
|
---|
20 | command:</para>
|
---|
21 |
|
---|
22 | <screen><userinput>cat > /etc/group << "EOF"</userinput>
|
---|
23 | root:x:0:
|
---|
24 | bin:x:1:
|
---|
25 | sys:x:2:
|
---|
26 | kmem:x:3:
|
---|
27 | tty:x:4:
|
---|
28 | tape:x:5:
|
---|
29 | daemon:x:6:
|
---|
30 | floppy:x:7:
|
---|
31 | disk:x:8:
|
---|
32 | lp:x:9:
|
---|
33 | dialout:x:10:
|
---|
34 | audio:x:11:
|
---|
35 | <userinput>EOF</userinput></screen>
|
---|
36 |
|
---|
37 | <para>The created groups aren't part of any standard -- they are the groups
|
---|
38 | that the MAKEDEV script in the next section uses. Besides the group "root", the
|
---|
39 | LSB (<ulink url="http://www.linuxbase.org"/>) recommends only a group "bin",
|
---|
40 | with a GID of 1, be present. All other group names and GIDs can be chosen
|
---|
41 | freely by the user, as well-written packages don't depend on GID numbers but
|
---|
42 | use the group's name.</para>
|
---|
43 |
|
---|
44 | <para>Lastly, we re-login to the chroot environment. User name and group name
|
---|
45 | resolution will start working immediately after the
|
---|
46 | <filename>/etc/passwd</filename> and <filename>/etc/group</filename> files are
|
---|
47 | created, because we installed a full Glibc in Chapter 5. This will get rid of
|
---|
48 | the <quote>I have no name!</quote> prompt.</para>
|
---|
49 |
|
---|
50 | <screen><userinput>exec /tools/bin/bash --login +h</userinput></screen>
|
---|
51 |
|
---|
52 |
|
---|
53 | </sect1>
|
---|
54 |
|
---|