[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 |
|
---|
| 11 | <title>Creating the passwd, group, and log 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 | <indexterm zone="ch-chroot-pwdgroup">
|
---|
| 22 | <primary sortas="e-/var/run/utmp">/var/run/utmp</primary>
|
---|
| 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="ch-chroot-pwdgroup">
|
---|
| 26 | <primary sortas="e-/var/log/btmp">/var/log/btmp</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <indexterm zone="ch-chroot-pwdgroup">
|
---|
| 30 | <primary sortas="e-/var/log/lastlog">/var/log/lastlog</primary>
|
---|
| 31 | </indexterm>
|
---|
| 32 |
|
---|
| 33 | <indexterm zone="ch-chroot-pwdgroup">
|
---|
| 34 | <primary sortas="e-/var/log/wtmp">/var/log/wtmp</primary>
|
---|
| 35 | </indexterm>
|
---|
| 36 |
|
---|
[dabbced] | 37 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[934e597] | 38 | href="../../boot/common/pwdgroup.xml"
|
---|
| 39 | xpointer="xpointer(//*[@os='a'])"/>
|
---|
| 40 |
|
---|
[3f8be484] | 41 | <para>Create the <filename>/etc/passwd</filename> file by running the
|
---|
| 42 | following command:</para>
|
---|
| 43 |
|
---|
| 44 | <screen><userinput>cat > /etc/passwd << "EOF"
|
---|
[8f1ae86] | 45 | <literal>root:x:&uid-root;:&gid-root;:root:/root:/bin/bash</literal>
|
---|
[a709a94] | 46 | <literal>bin:x:&uid-bin;:*gid-bin;:/dev/null:/bin/false</literal>
|
---|
| 47 | <literal>daemon:x:&uid-daemon;:&gid-daemon;:/dev/null:/bin/false</literal>
|
---|
[27f57ec] | 48 | <literal>messagebus:x:&uid-messagebus;:&gid-messagebus;:D-Bus Message Daemon User:/dev/null:/bin/false</literal>
|
---|
[a709a94] | 49 | <literal>nobody:x:&uid-nobody;:&gid-nobody;:Unprivileged User:/dev/null:/bin/false</literal>
|
---|
[3f8be484] | 50 | EOF</userinput></screen>
|
---|
| 51 |
|
---|
[934e597] | 52 | <para os="b">The actual password for
|
---|
[b2011e5] | 53 | <systemitem class="username">root</systemitem> (the <quote>x</quote>
|
---|
| 54 | used here is just a placeholder) will be set later.</para>
|
---|
[3f8be484] | 55 |
|
---|
[dabbced] | 56 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[65018363] | 57 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 58 | xpointer="xpointer(//*[@os='c'])"/>
|
---|
[65018363] | 59 |
|
---|
[3f8be484] | 60 | <para>Create the <filename>/etc/group</filename> file by running the
|
---|
| 61 | following command:</para>
|
---|
| 62 |
|
---|
| 63 | <screen><userinput>cat > /etc/group << "EOF"
|
---|
[65018363] | 64 | <literal>root:x:0:
|
---|
[8f1ae86] | 65 | bin:x:&gid-bin;:
|
---|
| 66 | sys:x:&gid-sys;:
|
---|
| 67 | kmem:x:&gid-kmem;:
|
---|
| 68 | tty:x:&gid-tty;:
|
---|
| 69 | tape:x:&gid-tape;:
|
---|
| 70 | daemon:x:&gid-daemon;:
|
---|
| 71 | floppy:x:&gid-floppy;:
|
---|
| 72 | disk:x:&gid-disk;:
|
---|
| 73 | lp:x:&gid-lp;:
|
---|
| 74 | dialout:x:&gid-dialout;:
|
---|
| 75 | audio:x:&gid-audio;:
|
---|
| 76 | video:x:&gid-video;:
|
---|
| 77 | utmp:x:&gid-utmp;:
|
---|
| 78 | usb:x:&gid-usb;:
|
---|
[27f57ec] | 79 | cdrom:x:&gid-cdrom;:
|
---|
[a709a94] | 80 | adm:x:&gid-adm;:
|
---|
[edaed14] | 81 | messagebus:x:&gid-messagebus;:
|
---|
[a709a94] | 82 | systemd-journal:x:&gid-systemd-journal;:
|
---|
| 83 | mail:x:&gid-mail;:
|
---|
| 84 | nogroup:x:&gid-nogroup;:</literal>
|
---|
[3f8be484] | 85 | EOF</userinput></screen>
|
---|
| 86 |
|
---|
[dabbced] | 87 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[3f8be484] | 88 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 89 | xpointer="xpointer(//*[@os='d'])"/>
|
---|
[65018363] | 90 |
|
---|
[dabbced] | 91 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[65018363] | 92 | href="../../boot/common/pwdgroup.xml"
|
---|
[934e597] | 93 | xpointer="xpointer(//*[@os='e'])"/>
|
---|
[65018363] | 94 |
|
---|
[3f8be484] | 95 | <para>To remove the <quote>I have no name!</quote> prompt, start a
|
---|
| 96 | new shell. Since a full Glibc was installed in <xref
|
---|
| 97 | linkend="chapter-cross-tools"/> and the <filename>/etc/passwd</filename>
|
---|
| 98 | and <filename>/etc/group</filename> files have been created, user name
|
---|
| 99 | and group name resolution will now work.</para>
|
---|
| 100 |
|
---|
[0f3854e] | 101 | <screen role="nodump"><userinput>exec /tools/bin/bash --login +h</userinput></screen>
|
---|
[3f8be484] | 102 |
|
---|
| 103 | <para>Note the use of the <parameter>+h</parameter> directive. This tells
|
---|
| 104 | <command>bash</command> not to use its internal path hashing. Without this
|
---|
| 105 | directive, <command>bash</command> would remember the paths to binaries it
|
---|
| 106 | has executed. To ensure the use of the newly compiled binaries as soon as
|
---|
| 107 | they are installed, the <parameter>+h</parameter> directive will be used
|
---|
[b5b8335] | 108 | for the duration of the next chapters.</para>
|
---|
[3f8be484] | 109 |
|
---|
| 110 | </sect1>
|
---|