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