source: BOOK/boot/common/pwdgroup.xml@ 5c8e74d

Last change on this file since 5c8e74d was c3b54fac, checked in by Chris Staub <chris@…>, 11 years ago

Cleanup of passwd/group creation

  • Property mode set to 100644
File size: 5.6 KB
RevLine 
[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-boot-pwdgroup">
9 <?dbhtml filename="pwdgroup.html"?>
10
[8a62e94]11 <title>Creating the passwd and group Files</title>
[3f8be484]12
13 <indexterm zone="ch-boot-pwdgroup">
[91ad4a4]14 <primary sortas="e-/etc/passwd">/etc/passwd</primary>
[3f8be484]15 </indexterm>
16
17 <indexterm zone="ch-boot-pwdgroup">
[91ad4a4]18 <primary sortas="e-/etc/group">/etc/group</primary>
[3f8be484]19 </indexterm>
20
[934e597]21 <para os="a">In order for user <systemitem class="username">root</systemitem> to
[3f8be484]22 be able to login and for the name <quote>root</quote> to be recognized,
[91ad4a4]23 there must be relevant entries in the <filename>/etc/passwd</filename>
24 and <filename>/etc/group</filename> files.</para>
[3f8be484]25
[3f76cac]26 <para>Create the <filename>${CLFS}/etc/passwd</filename> file by running
[3f8be484]27 the following command:</para>
28
[3f76cac]29<screen><userinput>cat &gt; ${CLFS}/etc/passwd &lt;&lt; "EOF"
[a49b75d]30<literal>root::&uid-root;:&gid-root;:root:/root:/bin/bash</literal>
[c3b54fac]31<literal>bin:x:&uid-bin;:&gid-bin;:/bin:/bin/false</literal>
32<literal>daemon:x:&uid-daemon;:&gid-daemon;:/sbin:/bin/false</literal>
[27f57ec]33<literal>messagebus:x:&uid-messagebus;:&gid-messagebus;:D-Bus Message Daemon User:/dev/null:/bin/false</literal>
[43748ab]34<literal>nobody:x:&uid-nobody;:&gid-nogroup;:Unprivileged User:/dev/null:/bin/false</literal>
[65018363]35EOF</userinput></screen>
36
[934e597]37 <para os="b">The actual password for <systemitem class="username">root</systemitem>
[d1ff581]38 (the <quote>::</quote> used here is just a placeholder and allows you to login
[b2011e5]39 with no password) will be set later.</para>
[3f8be484]40
[934e597]41 <variablelist os="c">
[04fe8e5]42
[a709a94]43 <title>Additional users you may want to add if not already included:</title>
[04fe8e5]44
45 <varlistentry>
[8f1ae86]46 <term><literal>adm:x:&uid-adm;:&gid-adm;:adm:/var/adm:/bin/false</literal></term>
[04fe8e5]47 <listitem>
[292da92]48 <para>Was used for programs that performed administrative tasks.</para>
[04fe8e5]49 </listitem>
50 </varlistentry>
51 <varlistentry>
[8f1ae86]52 <term><literal>lp:x:&uid-lp;:&gid-lp;:lp:/var/spool/lp:/bin/false</literal></term>
[04fe8e5]53 <listitem>
[b2011e5]54 <para>Used by programs for printing</para>
[04fe8e5]55 </listitem>
56 </varlistentry>
57 <varlistentry>
[8f1ae86]58 <term><literal>mail:x:&uid-mail;:&gid-mail;:mail:/var/mail:/bin/false</literal></term>
[04fe8e5]59 <listitem>
[b2011e5]60 <para>Often used by email programs</para>
[04fe8e5]61 </listitem>
62 </varlistentry>
63 <varlistentry>
[8f1ae86]64 <term><literal>news:x:&uid-news;:&gid-news;:news:/var/spool/news:/bin/false</literal></term>
[04fe8e5]65 <listitem>
[292da92]66 <para>Often used for network news servers</para>
[04fe8e5]67 </listitem>
68 </varlistentry>
69 <varlistentry>
[8f1ae86]70 <term><literal>operator:x:&uid-operator;:&gid-root;:operator:/root:/bin/bash</literal></term>
[04fe8e5]71 <listitem>
[292da92]72 <para>Often used to allow system operators to access the system</para>
[04fe8e5]73 </listitem>
74 </varlistentry>
75 <varlistentry>
[8f1ae86]76 <term><literal>postmaster:x:&uid-postmaster;:&gid-mail;:postmaster:/var/spool/mail:/bin/false</literal></term>
[04fe8e5]77 <listitem>
[9b020e6]78 <para>Generally used as an account that receives all the information of troubles with the mail server</para>
[04fe8e5]79 </listitem>
80 </varlistentry>
81 </variablelist>
82
[ca77da8]83 <para>Create the <filename>${CLFS}/etc/group</filename> file by running
[3f8be484]84 the following command:</para>
85
[3f76cac]86<screen><userinput>cat &gt; ${CLFS}/etc/group &lt;&lt; "EOF"
[65018363]87<literal>root:x:0:
[8f1ae86]88bin:x:&gid-bin;:
89sys:x:&gid-sys;:
90kmem:x:&gid-kmem;:
91tty:x:&gid-tty;:
92tape:x:&gid-tape;:
93daemon:x:&gid-daemon;:
94floppy:x:&gid-floppy;:
95disk:x:&gid-disk;:
96lp:x:&gid-lp;:
97dialout:x:&gid-dialout;:
98audio:x:&gid-audio;:
99video:x:&gid-video;:
100utmp:x:&gid-utmp;:
101usb:x:&gid-usb;:
[27f57ec]102cdrom:x:&gid-cdrom;:
[43748ab]103adm:x:&gid-adm;:
104messagebus:x:&gid-messagebus;:
105systemd-journal:x:&gid-systemd-journal;:
106mail:x:&gid-mail;:
107wheel:x:&gid-wheel;:
108nogroup:x:&gid-nogroup;:</literal>
[65018363]109EOF</userinput></screen>
110
[934e597]111 <variablelist os="d">
[8300133]112
[a709a94]113 <title>Additional groups you may want to add if not already included:</title>
[8300133]114
115 <varlistentry>
[8f1ae86]116 <term><literal>console:x:&gid-console;:</literal></term>
[8300133]117 <listitem>
[292da92]118 <para>This group has direct access to the console</para>
[8300133]119 </listitem>
120 </varlistentry>
121 <varlistentry>
[8f1ae86]122 <term><literal>cdrw:x:&gid-cdrw;:</literal></term>
[8300133]123 <listitem>
[292da92]124 <para>This group is allowed to use the CDRW drive</para>
[8300133]125 </listitem>
126 </varlistentry>
127 <varlistentry>
[8f1ae86]128 <term><literal>news:x:&gid-news;:news</literal></term>
[8300133]129 <listitem>
[292da92]130 <para>Used by Network News Servers</para>
[8300133]131 </listitem>
132 </varlistentry>
133 <varlistentry>
[8f1ae86]134 <term><literal>users:x:&gid-users;:</literal></term>
[8300133]135 <listitem>
[b2011e5]136 <para>The default GID used by shadow for new users</para>
[8300133]137 </listitem>
138 </varlistentry>
139 <varlistentry>
[ef54ce8]140 <term><literal>nobody:x:&gid-nogroup;:</literal></term>
[8300133]141 <listitem>
[9b020e6]142 <para>This is used by NFS</para>
[8300133]143 </listitem>
144 </varlistentry>
[a90a072]145 </variablelist>
[3f8be484]146
[934e597]147 <para os="e">The created groups are not part of any standard&mdash;they are
[eb39137]148 groups decided on in part by the requirements of the Systemd configuration
[3f8be484]149 in the final system, and in part by common convention employed by a
150 number of existing Linux distributions. The Linux Standard Base (LSB,
151 available at <ulink url="http://www.linuxbase.org"/>) recommends only
152 that, besides the group <quote>root</quote> with a Group ID (GID) of 0,
153 a group <quote>bin</quote> with a GID of 1 be present. All other group
154 names and GIDs can be chosen freely by the system administrator since
155 well-written programs do not depend on GID numbers, but rather use the
156 group's name.</para>
157
158</sect1>
Note: See TracBrowser for help on using the repository browser.