[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" |
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ |
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent"> |
---|
| 5 | %general-entities; |
---|
| 6 | ]> |
---|
| 7 | |
---|
| 8 | <sect1 id="ch-boot-pwdgroup"> |
---|
| 9 | <?dbhtml filename="pwdgroup.html"?> |
---|
| 10 | |
---|
| 11 | <title>Creating the passwd, group, and log Files</title> |
---|
| 12 | |
---|
| 13 | <indexterm zone="ch-boot-pwdgroup"> |
---|
| 14 | <primary sortas="e-${LFS}/etc/passwd">${LFS}/etc/passwd</primary> |
---|
| 15 | </indexterm> |
---|
| 16 | |
---|
| 17 | <indexterm zone="ch-boot-pwdgroup"> |
---|
| 18 | <primary sortas="e-${LFS}/etc/group">${LFS}/etc/group</primary> |
---|
| 19 | </indexterm> |
---|
| 20 | |
---|
| 21 | <indexterm zone="ch-boot-pwdgroup"> |
---|
| 22 | <primary sortas="e-${LFS}/var/run/utmp">${LFS}/var/run/utmp</primary> |
---|
| 23 | </indexterm> |
---|
| 24 | |
---|
| 25 | <indexterm zone="ch-boot-pwdgroup"> |
---|
| 26 | <primary sortas="e-${LFS}/var/log/btmp">${LFS}/var/log/btmp</primary> |
---|
| 27 | </indexterm> |
---|
| 28 | |
---|
| 29 | <indexterm zone="ch-boot-pwdgroup"> |
---|
| 30 | <primary sortas="e-${LFS}/var/log/lastlog">${LFS}/var/log/lastlog</primary> |
---|
| 31 | </indexterm> |
---|
| 32 | |
---|
| 33 | <indexterm zone="ch-boot-pwdgroup"> |
---|
| 34 | <primary sortas="e-${LFS}/var/log/wtmp">${LFS}/var/log/wtmp</primary> |
---|
| 35 | </indexterm> |
---|
| 36 | |
---|
| 37 | <para>In order for user <systemitem class="username">root</systemitem> to |
---|
| 38 | be able to login and for the name <quote>root</quote> to be recognized, |
---|
| 39 | there must be relevant entries in the <filename>${LFS}/etc/passwd</filename> |
---|
| 40 | and <filename>${LFS}/etc/group</filename> files.</para> |
---|
| 41 | |
---|
| 42 | <para>Create the <filename>${LFS}/etc/passwd</filename> file by running |
---|
| 43 | the following command:</para> |
---|
| 44 | |
---|
| 45 | <screen><userinput>cat > ${LFS}/etc/passwd << "EOF" |
---|
[65018363] | 46 | <literal>root:x:0:0:root:/root:/bin/bash</literal> |
---|
| 47 | EOF</userinput></screen> |
---|
| 48 | |
---|
| 49 | <para os="a">TO BE WRITTEN: more text describing additional users |
---|
[3f8be484] | 50 | bin:x:1:1:bin:/bin:/bin/false |
---|
[65018363] | 51 | daemon:x:2:6:daemon:/sbin:/bin/false |
---|
| 52 | adm:x:3:16:adm:/var/adm:/bin/false |
---|
| 53 | lp:x:10:9:lp:/var/spool/lp:/bin/false |
---|
[3f8be484] | 54 | mail:x:30:30:mail:/var/spool/mail:/bin/false |
---|
| 55 | news:x:31:31:news:/var/spool/news:/bin/false |
---|
| 56 | uucp:x:32:32:uucp:/var/spool/uucp:/bin/false |
---|
| 57 | operator:x:50:0:operator:/root:/bin/bash |
---|
| 58 | postmaster:x:51:30:postmaster:/var/spool/mail:/bin/false |
---|
[65018363] | 59 | nobody:x:65534:65534:nobody:/:/bin/false</para> |
---|
[3f8be484] | 60 | |
---|
[65018363] | 61 | <para os="b">The actual password for <systemitem class="username">root</systemitem> |
---|
[3f8be484] | 62 | (the <quote>x</quote> used here is just a placeholder) will be set |
---|
| 63 | later.</para> |
---|
| 64 | |
---|
| 65 | <para>Create the <filename>${LFS}/etc/group</filename> file by running |
---|
| 66 | the following command:</para> |
---|
| 67 | |
---|
| 68 | <screen><userinput>cat > ${LFS}/etc/group << "EOF" |
---|
[65018363] | 69 | <literal>root:x:0: |
---|
| 70 | bin:x:1: |
---|
| 71 | sys:x:2: |
---|
| 72 | kmem:x:3: |
---|
| 73 | tty:x:4: |
---|
| 74 | tape:x:5: |
---|
| 75 | daemon:x:6: |
---|
| 76 | floppy:x:7: |
---|
| 77 | disk:x:8: |
---|
| 78 | lp:x:9: |
---|
| 79 | dialout:x:10: |
---|
| 80 | audio:x:11: |
---|
| 81 | video:x:12: |
---|
| 82 | utmp:x:13: |
---|
| 83 | usb:x:14: |
---|
| 84 | cdrom:x:15:</literal> |
---|
| 85 | EOF</userinput></screen> |
---|
| 86 | |
---|
| 87 | <para os="c">TO BE WRITTEN: more text describing additional groups |
---|
| 88 | adm::16:root,adm,daemon |
---|
| 89 | console::17: |
---|
| 90 | cdrw::18: |
---|
[3f8be484] | 91 | mail::30:mail |
---|
| 92 | news::31:news |
---|
| 93 | uucp::32:uucp |
---|
| 94 | users::100: |
---|
| 95 | nogroup::65533: |
---|
[65018363] | 96 | nobody::65534:</para> |
---|
[3f8be484] | 97 | |
---|
[65018363] | 98 | <para os="d">The created groups are not part of any standard—they are |
---|
[3f8be484] | 99 | groups decided on in part by the requirements of the Udev configuration |
---|
| 100 | in the final system, and in part by common convention employed by a |
---|
| 101 | number of existing Linux distributions. The Linux Standard Base (LSB, |
---|
| 102 | available at <ulink url="http://www.linuxbase.org"/>) recommends only |
---|
| 103 | that, besides the group <quote>root</quote> with a Group ID (GID) of 0, |
---|
| 104 | a group <quote>bin</quote> with a GID of 1 be present. All other group |
---|
| 105 | names and GIDs can be chosen freely by the system administrator since |
---|
| 106 | well-written programs do not depend on GID numbers, but rather use the |
---|
| 107 | group's name.</para> |
---|
| 108 | |
---|
[65018363] | 109 | <para os="e">The <command>login</command>, <command>agetty</command>, and |
---|
[3f8be484] | 110 | <command>init</command> programs (and others) use a number of log |
---|
| 111 | files to record information such as who was logged into the system and |
---|
| 112 | when. However, these programs will not write to the log files if they |
---|
| 113 | do not already exist. Initialize the log files and give them |
---|
| 114 | proper permissions:</para> |
---|
| 115 | |
---|
| 116 | <screen><userinput>touch ${LFS}/var/run/utmp ${LFS}/var/log/{btmp,lastlog,wtmp} |
---|
[eb55250] | 117 | chmod -v 664 ${LFS}/var/run/utmp ${LFS}/var/log/lastlog |
---|
| 118 | chmod -v 600 ${LFS}/var/log/btmp</userinput></screen> |
---|
[3f8be484] | 119 | |
---|
| 120 | <para>The <filename>${LFS}/var/run/utmp</filename> file records the users |
---|
| 121 | that are currently logged in. The <filename>${LFS}/var/log/wtmp</filename> |
---|
| 122 | file records all logins and logouts. The |
---|
| 123 | <filename>${LFS}/var/log/lastlog</filename> file records when |
---|
| 124 | each user last logged in. The <filename>${LFS}/var/log/btmp</filename> file |
---|
| 125 | records the bad login attempts.</para> |
---|
| 126 | |
---|
| 127 | </sect1> |
---|