source: postlfs/config/skel.xml@ d5cc78a

11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since d5cc78a was 81a73ed8, checked in by Pierre Labastie <pieere@…>, 4 years ago

Format postlfs config

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22886 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 5.8 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="postlfs-config-skel" xreflabel="Configuring for Adding Users">
9 <?dbhtml filename="skel.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>Configuring for Adding Users</title>
17
18 <indexterm zone="postlfs-config-skel">
19 <primary sortas="e-etc-skel">/etc/skel/*</primary>
20 </indexterm>
21
22 <indexterm zone="postlfs-config-skel">
23 <primary sortas="e-etc-default-useradd">/etc/default/useradd</primary>
24 </indexterm>
25
26 <para>
27 Together, the <command>/usr/sbin/useradd</command> command and <filename
28 class="directory">/etc/skel</filename> directory (both are easy to
29 set up and use) provide a way to assure new users are added to your LFS
30 system with the same beginning settings for things such as the
31 <envar>PATH</envar>, keyboard processing and other environmental variables.
32 Using these two facilities makes it easier to assure this initial state for
33 each new user added to the system.
34 </para>
35
36 <para>
37 The <filename class="directory">/etc/skel</filename> directory holds
38 copies of various initialization and other files that may be copied to the
39 new user's home directory when the <command>/usr/sbin/useradd</command>
40 program adds the new user.
41 </para>
42
43 <bridgehead renderas="sect5">Useradd</bridgehead>
44
45 <para>
46 The <command>useradd</command> program uses a collection of default
47 values kept in <filename>/etc/default/useradd</filename>. This file
48 is created in a base LFS installation by the
49 <application>Shadow</application> package. If it has been removed or
50 renamed, the <command>useradd</command> program uses some internal
51 defaults. You can see the default values by running
52 <command>/usr/sbin/useradd -D</command>.
53 </para>
54
55 <para>
56 To change these values, simply modify the
57 <filename>/etc/default/useradd</filename> file as the
58 <systemitem class='username'>root</systemitem> user. An alternative to
59 directly modifying the file is to run <command>useradd</command> as the
60 <systemitem class='username'>root</systemitem> user while supplying the
61 desired modifications on the command line. Information on how to do this
62 can be found in the <command>useradd</command> man page.
63 </para>
64
65 <bridgehead renderas="sect5">/etc/skel</bridgehead>
66
67 <para>
68 To get started, create an
69 <filename class="directory">/etc/skel</filename> directory and make sure it
70 is writable only by the system administrator, usually
71 <systemitem class="username">root</systemitem>. Creating the directory as
72 <systemitem class="username">root</systemitem> is the best way to go.
73 </para>
74
75 <para>
76 The mode of any files from this part of the book that you put in <filename
77 class="directory">/etc/skel</filename> should be writable only by the
78 owner. Also, since there is no telling what kind of sensitive information
79 a user may eventually place in their copy of these files, you should
80 make them unreadable by "group" and "other".
81 </para>
82
83 <para>
84 You can also put other files in
85 <filename class="directory">/etc/skel</filename> and
86 different permissions may be needed for them.
87 </para>
88
89 <para>
90 Decide which initialization files should be provided in every (or most)
91 new user's home directory. The decisions you make will affect what you
92 do in the next two sections, <xref linkend="postlfs-config-profile"/> and
93 <xref linkend="postlfs-config-vimrc"/>. Some or all of those files will be
94 useful for <systemitem class="username">root</systemitem>, any
95 already-existing users, and new users.
96 </para>
97
98 <para>
99 The files from those sections that you might want to place in
100 <filename class="directory">/etc/skel</filename> include
101 <filename>.inputrc</filename>, <filename>.bash_profile</filename>,
102 <filename>.bashrc</filename>, <filename>.bash_logout</filename>,
103 <filename>.dircolors</filename>, and <filename>.vimrc</filename>. If
104 you are unsure which of these should be placed there, just continue to
105 the following sections, read each section and any references provided,
106 and then make your decision.
107 </para>
108
109 <para>
110 You will run a slightly modified set of commands for files which are
111 placed in <filename class="directory">/etc/skel</filename>. Each section
112 will remind you of this. In brief, the book's commands have been written
113 for files <emphasis>not</emphasis> added to <filename class="directory">
114 /etc/skel</filename> and instead just sends the results to the user's
115 home directory. If the file is going to be in <filename class="directory">
116 /etc/skel</filename>, change the book's command(s) to send output there
117 instead and then just copy the file from <filename class="directory">
118 /etc/skel</filename> to the appropriate directories, like <filename
119 class="directory">/etc</filename>, <filename class="directory">~
120 </filename> or the home directory of any other user already in the system.
121 </para>
122
123 <bridgehead renderas="sect5">When Adding a User</bridgehead>
124
125 <para>
126 When adding a new user with <command>useradd</command>, use
127 the <option>-m</option> parameter, which tells
128 <command>useradd</command> to create the user's home directory and
129 copy files from <filename class="directory">/etc/skel</filename> (can be
130 overridden) to the new user's home directory. For example (perform as the
131 <systemitem class="username">root</systemitem> user):
132 </para>
133
134<screen role="root"><userinput>useradd -m <replaceable>&lt;newuser&gt;</replaceable></userinput></screen>
135
136</sect1>
Note: See TracBrowser for help on using the repository browser.