source: BOOK/boot/common/pwdgroup.xml@ 0e945fa

clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 0e945fa 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
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/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 and group Files</title>
12
13 <indexterm zone="ch-boot-pwdgroup">
14 <primary sortas="e-/etc/passwd">/etc/passwd</primary>
15 </indexterm>
16
17 <indexterm zone="ch-boot-pwdgroup">
18 <primary sortas="e-/etc/group">/etc/group</primary>
19 </indexterm>
20
21 <para os="a">In order for user <systemitem class="username">root</systemitem> to
22 be able to login and for the name <quote>root</quote> to be recognized,
23 there must be relevant entries in the <filename>/etc/passwd</filename>
24 and <filename>/etc/group</filename> files.</para>
25
26 <para>Create the <filename>${CLFS}/etc/passwd</filename> file by running
27 the following command:</para>
28
29<screen><userinput>cat &gt; ${CLFS}/etc/passwd &lt;&lt; "EOF"
30<literal>root::&uid-root;:&gid-root;:root:/root:/bin/bash</literal>
31<literal>bin:x:&uid-bin;:&gid-bin;:/bin:/bin/false</literal>
32<literal>daemon:x:&uid-daemon;:&gid-daemon;:/sbin:/bin/false</literal>
33<literal>messagebus:x:&uid-messagebus;:&gid-messagebus;:D-Bus Message Daemon User:/dev/null:/bin/false</literal>
34<literal>nobody:x:&uid-nobody;:&gid-nogroup;:Unprivileged User:/dev/null:/bin/false</literal>
35EOF</userinput></screen>
36
37 <para os="b">The actual password for <systemitem class="username">root</systemitem>
38 (the <quote>::</quote> used here is just a placeholder and allows you to login
39 with no password) will be set later.</para>
40
41 <variablelist os="c">
42
43 <title>Additional users you may want to add if not already included:</title>
44
45 <varlistentry>
46 <term><literal>adm:x:&uid-adm;:&gid-adm;:adm:/var/adm:/bin/false</literal></term>
47 <listitem>
48 <para>Was used for programs that performed administrative tasks.</para>
49 </listitem>
50 </varlistentry>
51 <varlistentry>
52 <term><literal>lp:x:&uid-lp;:&gid-lp;:lp:/var/spool/lp:/bin/false</literal></term>
53 <listitem>
54 <para>Used by programs for printing</para>
55 </listitem>
56 </varlistentry>
57 <varlistentry>
58 <term><literal>mail:x:&uid-mail;:&gid-mail;:mail:/var/mail:/bin/false</literal></term>
59 <listitem>
60 <para>Often used by email programs</para>
61 </listitem>
62 </varlistentry>
63 <varlistentry>
64 <term><literal>news:x:&uid-news;:&gid-news;:news:/var/spool/news:/bin/false</literal></term>
65 <listitem>
66 <para>Often used for network news servers</para>
67 </listitem>
68 </varlistentry>
69 <varlistentry>
70 <term><literal>operator:x:&uid-operator;:&gid-root;:operator:/root:/bin/bash</literal></term>
71 <listitem>
72 <para>Often used to allow system operators to access the system</para>
73 </listitem>
74 </varlistentry>
75 <varlistentry>
76 <term><literal>postmaster:x:&uid-postmaster;:&gid-mail;:postmaster:/var/spool/mail:/bin/false</literal></term>
77 <listitem>
78 <para>Generally used as an account that receives all the information of troubles with the mail server</para>
79 </listitem>
80 </varlistentry>
81 </variablelist>
82
83 <para>Create the <filename>${CLFS}/etc/group</filename> file by running
84 the following command:</para>
85
86<screen><userinput>cat &gt; ${CLFS}/etc/group &lt;&lt; "EOF"
87<literal>root:x:0:
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;:
102cdrom:x:&gid-cdrom;:
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>
109EOF</userinput></screen>
110
111 <variablelist os="d">
112
113 <title>Additional groups you may want to add if not already included:</title>
114
115 <varlistentry>
116 <term><literal>console:x:&gid-console;:</literal></term>
117 <listitem>
118 <para>This group has direct access to the console</para>
119 </listitem>
120 </varlistentry>
121 <varlistentry>
122 <term><literal>cdrw:x:&gid-cdrw;:</literal></term>
123 <listitem>
124 <para>This group is allowed to use the CDRW drive</para>
125 </listitem>
126 </varlistentry>
127 <varlistentry>
128 <term><literal>news:x:&gid-news;:news</literal></term>
129 <listitem>
130 <para>Used by Network News Servers</para>
131 </listitem>
132 </varlistentry>
133 <varlistentry>
134 <term><literal>users:x:&gid-users;:</literal></term>
135 <listitem>
136 <para>The default GID used by shadow for new users</para>
137 </listitem>
138 </varlistentry>
139 <varlistentry>
140 <term><literal>nobody:x:&gid-nogroup;:</literal></term>
141 <listitem>
142 <para>This is used by NFS</para>
143 </listitem>
144 </varlistentry>
145 </variablelist>
146
147 <para os="e">The created groups are not part of any standard&mdash;they are
148 groups decided on in part by the requirements of the Systemd configuration
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.