[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-chroot-pwdgroup">
|
---|
| 9 | <?dbhtml filename="pwdgroup.html"?>
|
---|
| 10 |
|
---|
[8a62e94] | 11 | <title>Creating the passwd and group Files</title>
|
---|
[3f8be484] | 12 |
|
---|
| 13 | <indexterm zone="ch-chroot-pwdgroup">
|
---|
| 14 | <primary sortas="e-/etc/passwd">/etc/passwd</primary>
|
---|
[2ba92901] | 15 | <secondary>chroot</secondary>
|
---|
[3f8be484] | 16 | </indexterm>
|
---|
| 17 |
|
---|
| 18 | <indexterm zone="ch-chroot-pwdgroup">
|
---|
| 19 | <primary sortas="e-/etc/group">/etc/group</primary>
|
---|
[2ba92901] | 20 | <secondary>chroot</secondary>
|
---|
[3f8be484] | 21 | </indexterm>
|
---|
| 22 |
|
---|
[dabbced] | 23 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[934e597] | 24 | href="../../boot/common/pwdgroup.xml"
|
---|
| 25 | xpointer="xpointer(//*[@os='a'])"/>
|
---|
| 26 |
|
---|
[3f8be484] | 27 | <para>Create the <filename>/etc/passwd</filename> file by running the
|
---|
| 28 | following command:</para>
|
---|
| 29 |
|
---|
| 30 | <screen><userinput>cat > /etc/passwd << "EOF"
|
---|
[8f1ae86] | 31 | <literal>root:x:&uid-root;:&gid-root;:root:/root:/bin/bash</literal>
|
---|
[c3b54fac] | 32 | <literal>bin:x:&uid-bin;:&gid-bin;:/bin:/bin/false</literal>
|
---|
| 33 | <literal>daemon:x:&uid-daemon;:&gid-daemon;:/sbin:/bin/false</literal>
|
---|
[27f57ec] | 34 | <literal>messagebus:x:&uid-messagebus;:&gid-messagebus;:D-Bus Message Daemon User:/dev/null:/bin/false</literal>
|
---|
[ef54ce8] | 35 | <literal>nobody:x:&uid-nobody;:&gid-nogroup;:Unprivileged User:/dev/null:/bin/false</literal>
|
---|
[3f8be484] | 36 | EOF</userinput></screen>
|
---|
| 37 |
|
---|
[934e597] | 38 | <para os="b">The actual password for
|
---|
[b2011e5] | 39 | <systemitem class="username">root</systemitem> (the <quote>x</quote>
|
---|
| 40 | used here is just a placeholder) will be set later.</para>
|
---|
[3f8be484] | 41 |
|
---|
[dabbced] | 42 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[65018363] | 43 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 44 | xpointer="xpointer(//*[@os='c'])"/>
|
---|
[65018363] | 45 |
|
---|
[3f8be484] | 46 | <para>Create the <filename>/etc/group</filename> file by running the
|
---|
| 47 | following command:</para>
|
---|
| 48 |
|
---|
| 49 | <screen><userinput>cat > /etc/group << "EOF"
|
---|
[65018363] | 50 | <literal>root:x:0:
|
---|
[8f1ae86] | 51 | bin:x:&gid-bin;:
|
---|
| 52 | sys:x:&gid-sys;:
|
---|
| 53 | kmem:x:&gid-kmem;:
|
---|
| 54 | tty:x:&gid-tty;:
|
---|
| 55 | tape:x:&gid-tape;:
|
---|
| 56 | daemon:x:&gid-daemon;:
|
---|
| 57 | floppy:x:&gid-floppy;:
|
---|
| 58 | disk:x:&gid-disk;:
|
---|
| 59 | lp:x:&gid-lp;:
|
---|
| 60 | dialout:x:&gid-dialout;:
|
---|
| 61 | audio:x:&gid-audio;:
|
---|
| 62 | video:x:&gid-video;:
|
---|
| 63 | utmp:x:&gid-utmp;:
|
---|
| 64 | usb:x:&gid-usb;:
|
---|
[27f57ec] | 65 | cdrom:x:&gid-cdrom;:
|
---|
[a709a94] | 66 | adm:x:&gid-adm;:
|
---|
[edaed14] | 67 | messagebus:x:&gid-messagebus;:
|
---|
[a709a94] | 68 | systemd-journal:x:&gid-systemd-journal;:
|
---|
| 69 | mail:x:&gid-mail;:
|
---|
[961afdcd] | 70 | wheel:x:&gid-wheel;:
|
---|
[a709a94] | 71 | nogroup:x:&gid-nogroup;:</literal>
|
---|
[3f8be484] | 72 | EOF</userinput></screen>
|
---|
| 73 |
|
---|
[dabbced] | 74 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[3f8be484] | 75 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 76 | xpointer="xpointer(//*[@os='d'])"/>
|
---|
[65018363] | 77 |
|
---|
[dabbced] | 78 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[65018363] | 79 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 80 | xpointer="xpointer(//*[@os='e'])"/>
|
---|
[65018363] | 81 |
|
---|
[3f8be484] | 82 | <para>To remove the <quote>I have no name!</quote> prompt, start a
|
---|
| 83 | new shell. Since a full Glibc was installed in <xref
|
---|
| 84 | linkend="chapter-cross-tools"/> and the <filename>/etc/passwd</filename>
|
---|
| 85 | and <filename>/etc/group</filename> files have been created, user name
|
---|
| 86 | and group name resolution will now work.</para>
|
---|
| 87 |
|
---|
[0f3854e] | 88 | <screen role="nodump"><userinput>exec /tools/bin/bash --login +h</userinput></screen>
|
---|
[3f8be484] | 89 |
|
---|
| 90 | <para>Note the use of the <parameter>+h</parameter> directive. This tells
|
---|
| 91 | <command>bash</command> not to use its internal path hashing. Without this
|
---|
| 92 | directive, <command>bash</command> would remember the paths to binaries it
|
---|
| 93 | has executed. To ensure the use of the newly compiled binaries as soon as
|
---|
| 94 | they are installed, the <parameter>+h</parameter> directive will be used
|
---|
[b5b8335] | 95 | for the duration of the next chapters.</para>
|
---|
[3f8be484] | 96 |
|
---|
| 97 | </sect1>
|
---|