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