source: BOOK/chroot/common/pwdgroup.xml@ 72d6a1b

clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 72d6a1b was ef54ce8, checked in by William Harrington <kb0iic@…>, 11 years ago

Replace gid-nobody with gid-nogroup.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/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 and group 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 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
22 href="../../boot/common/pwdgroup.xml"
23 xpointer="xpointer(//*[@os='a'])"/>
24
25 <para>Create the <filename>/etc/passwd</filename> file by running the
26 following command:</para>
27
28<screen><userinput>cat &gt; /etc/passwd &lt;&lt; "EOF"
29<literal>root:x:&uid-root;:&gid-root;:root:/root:/bin/bash</literal>
30<literal>bin:x:&uid-bin;:&gid-bin;:/dev/null:/bin/false</literal>
31<literal>daemon:x:&uid-daemon;:&gid-daemon;:/dev/null:/bin/false</literal>
32<literal>messagebus:x:&uid-messagebus;:&gid-messagebus;:D-Bus Message Daemon User:/dev/null:/bin/false</literal>
33<literal>nobody:x:&uid-nobody;:&gid-nogroup;:Unprivileged User:/dev/null:/bin/false</literal>
34EOF</userinput></screen>
35
36 <para os="b">The actual password for
37 <systemitem class="username">root</systemitem> (the <quote>x</quote>
38 used here is just a placeholder) will be set later.</para>
39
40 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
41 href="../../boot/common/pwdgroup.xml"
42 xpointer="xpointer(//*[@os='c'])"/>
43
44 <para>Create the <filename>/etc/group</filename> file by running the
45 following command:</para>
46
47<screen><userinput>cat &gt; /etc/group &lt;&lt; "EOF"
48<literal>root:x:0:
49bin:x:&gid-bin;:
50sys:x:&gid-sys;:
51kmem:x:&gid-kmem;:
52tty:x:&gid-tty;:
53tape:x:&gid-tape;:
54daemon:x:&gid-daemon;:
55floppy:x:&gid-floppy;:
56disk:x:&gid-disk;:
57lp:x:&gid-lp;:
58dialout:x:&gid-dialout;:
59audio:x:&gid-audio;:
60video:x:&gid-video;:
61utmp:x:&gid-utmp;:
62usb:x:&gid-usb;:
63cdrom:x:&gid-cdrom;:
64adm:x:&gid-adm;:
65messagebus:x:&gid-messagebus;:
66systemd-journal:x:&gid-systemd-journal;:
67mail:x:&gid-mail;:
68wheel:x:&gid-wheel;:
69nogroup:x:&gid-nogroup;:</literal>
70EOF</userinput></screen>
71
72 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
73 href="../../boot/common/pwdgroup.xml"
74 xpointer="xpointer(//*[@os='d'])"/>
75
76 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
77 href="../../boot/common/pwdgroup.xml"
78 xpointer="xpointer(//*[@os='e'])"/>
79
80 <para>To remove the <quote>I have no name!</quote> prompt, start a
81 new shell. Since a full Glibc was installed in <xref
82 linkend="chapter-cross-tools"/> and the <filename>/etc/passwd</filename>
83 and <filename>/etc/group</filename> files have been created, user name
84 and group name resolution will now work.</para>
85
86<screen role="nodump"><userinput>exec /tools/bin/bash --login +h</userinput></screen>
87
88 <para>Note the use of the <parameter>+h</parameter> directive. This tells
89 <command>bash</command> not to use its internal path hashing. Without this
90 directive, <command>bash</command> would remember the paths to binaries it
91 has executed. To ensure the use of the newly compiled binaries as soon as
92 they are installed, the <parameter>+h</parameter> directive will be used
93 for the duration of the next chapters.</para>
94
95</sect1>
Note: See TracBrowser for help on using the repository browser.