[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>
|
---|
| 15 | </indexterm>
|
---|
| 16 |
|
---|
| 17 | <indexterm zone="ch-chroot-pwdgroup">
|
---|
| 18 | <primary sortas="e-/etc/group">/etc/group</primary>
|
---|
| 19 | </indexterm>
|
---|
| 20 |
|
---|
[dabbced] | 21 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[934e597] | 22 | href="../../boot/common/pwdgroup.xml"
|
---|
| 23 | xpointer="xpointer(//*[@os='a'])"/>
|
---|
| 24 |
|
---|
[3f8be484] | 25 | <para>Create the <filename>/etc/passwd</filename> file by running the
|
---|
| 26 | following command:</para>
|
---|
| 27 |
|
---|
| 28 | <screen><userinput>cat > /etc/passwd << "EOF"
|
---|
[8f1ae86] | 29 | <literal>root:x:&uid-root;:&gid-root;:root:/root:/bin/bash</literal>
|
---|
[fa16dcec] | 30 | <literal>bin:x:&uid-bin;:&gid-bin;:/dev/null:/bin/false</literal>
|
---|
[a709a94] | 31 | <literal>daemon:x:&uid-daemon;:&gid-daemon;:/dev/null:/bin/false</literal>
|
---|
[27f57ec] | 32 | <literal>messagebus:x:&uid-messagebus;:&gid-messagebus;:D-Bus Message Daemon User:/dev/null:/bin/false</literal>
|
---|
[ef54ce8] | 33 | <literal>nobody:x:&uid-nobody;:&gid-nogroup;:Unprivileged User:/dev/null:/bin/false</literal>
|
---|
[3f8be484] | 34 | EOF</userinput></screen>
|
---|
| 35 |
|
---|
[934e597] | 36 | <para os="b">The actual password for
|
---|
[b2011e5] | 37 | <systemitem class="username">root</systemitem> (the <quote>x</quote>
|
---|
| 38 | used here is just a placeholder) will be set later.</para>
|
---|
[3f8be484] | 39 |
|
---|
[dabbced] | 40 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[65018363] | 41 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 42 | xpointer="xpointer(//*[@os='c'])"/>
|
---|
[65018363] | 43 |
|
---|
[3f8be484] | 44 | <para>Create the <filename>/etc/group</filename> file by running the
|
---|
| 45 | following command:</para>
|
---|
| 46 |
|
---|
| 47 | <screen><userinput>cat > /etc/group << "EOF"
|
---|
[65018363] | 48 | <literal>root:x:0:
|
---|
[8f1ae86] | 49 | bin:x:&gid-bin;:
|
---|
| 50 | sys:x:&gid-sys;:
|
---|
| 51 | kmem:x:&gid-kmem;:
|
---|
| 52 | tty:x:&gid-tty;:
|
---|
| 53 | tape:x:&gid-tape;:
|
---|
| 54 | daemon:x:&gid-daemon;:
|
---|
| 55 | floppy:x:&gid-floppy;:
|
---|
| 56 | disk:x:&gid-disk;:
|
---|
| 57 | lp:x:&gid-lp;:
|
---|
| 58 | dialout:x:&gid-dialout;:
|
---|
| 59 | audio:x:&gid-audio;:
|
---|
| 60 | video:x:&gid-video;:
|
---|
| 61 | utmp:x:&gid-utmp;:
|
---|
| 62 | usb:x:&gid-usb;:
|
---|
[27f57ec] | 63 | cdrom:x:&gid-cdrom;:
|
---|
[a709a94] | 64 | adm:x:&gid-adm;:
|
---|
[edaed14] | 65 | messagebus:x:&gid-messagebus;:
|
---|
[a709a94] | 66 | systemd-journal:x:&gid-systemd-journal;:
|
---|
| 67 | mail:x:&gid-mail;:
|
---|
[961afdcd] | 68 | wheel:x:&gid-wheel;:
|
---|
[a709a94] | 69 | nogroup:x:&gid-nogroup;:</literal>
|
---|
[3f8be484] | 70 | EOF</userinput></screen>
|
---|
| 71 |
|
---|
[dabbced] | 72 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[3f8be484] | 73 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 74 | xpointer="xpointer(//*[@os='d'])"/>
|
---|
[65018363] | 75 |
|
---|
[dabbced] | 76 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[65018363] | 77 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 78 | xpointer="xpointer(//*[@os='e'])"/>
|
---|
[65018363] | 79 |
|
---|
[3f8be484] | 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 |
|
---|
[0f3854e] | 86 | <screen role="nodump"><userinput>exec /tools/bin/bash --login +h</userinput></screen>
|
---|
[3f8be484] | 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
|
---|
[b5b8335] | 93 | for the duration of the next chapters.</para>
|
---|
[3f8be484] | 94 |
|
---|
| 95 | </sect1>
|
---|