source: postlfs/config/skel.xml@ 710e54d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 710e54d was e0d33ef, checked in by Randy McMurchy <randy@…>, 19 years ago

Removed excess spaces from the ends of lines in the source files

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

  • Property mode set to 100644
File size: 5.7 KB
RevLine 
[f8d632a]1<?xml version="1.0" encoding="ISO-8859-1"?>
[ff769b8c]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
[f8d632a]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
[0290a023]8<sect1 id="postlfs-config-skel" xreflabel="Configuring for Adding Users">
[991aa6f]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>Together, the <command>/usr/sbin/useradd</command> command and
[e0d33ef]27 <filename class="directory">/etc/skel</filename> directory (both are easy to
28 setup and use) provide a way to assure new users are added on your LFS
29 system with the same beginning settings for things like <envar>PATH</envar>,
30 keyboard processing and environmental variables. Using these two facilities
[991aa6f]31 makes it easier to assure this initial state for each new user.</para>
32
[e0d33ef]33 <para>The <filename class="directory">/etc/skel</filename> directory holds
34 copies of various initialization and other files that may be copied to the
[d612b9f]35 new user's home directory when the <command>/usr/sbin/useradd</command>
[991aa6f]36 program adds the new user.</para>
37
38<bridgehead renderas="sect5">Useradd</bridgehead>
39
40 <para>The <command>useradd</command> program uses a collection of
41 default values kept in <filename>/etc/default/useradd</filename>,
42 if it exists. If the file does not exist, then it uses some internal
[e0d33ef]43 defaults. You can see the default values by running
[991aa6f]44 <command>/usr/sbin/useradd -D</command>.</para>
45
46 <para>To change these values to something new, create a base <filename>
[e0d33ef]47 /etc/default/useradd</filename> file with the same values as the output of
[991aa6f]48 <command>/usr/sbin/useradd -D</command>. Here is a sample.</para>
49
50<screen><literal># Begin /etc/default/useradd
[7346f16]51
52GROUP=100
53HOME=/home
54INACTIVE=-1
55EXPIRE=
56SHELL=
57SKEL=/etc/skel
58
[991aa6f]59# End /etc/default/useradd</literal></screen>
60
61 <para>The only thing missing from the file is a default shell. Add that
62 by running:</para>
63
64<screen role="root"><userinput>/usr/sbin/useradd -D -s/bin/bash</userinput></screen>
65
[e0d33ef]66 <para>This will set the <envar>SHELL</envar>= line to
[991aa6f]67 <envar>SHELL</envar>=/bin/bash.</para>
68
69 <para><command>Useradd</command> has many parameters that
70 can be set in the <filename>/etc/default/useradd</filename> file.</para>
71
72 <para>For more information see <command>man useradd</command>.</para>
73
74 <bridgehead renderas="sect5">/etc/skel</bridgehead>
75
[e0d33ef]76 <para>To get started, create an <filename
77 class="directory">/etc/skel</filename> directory and make sure it is
78 writable only by the system administrator, usually <systemitem
79 class="username">root</systemitem>. Creating the
80 directory as <systemitem class="username">root</systemitem> is
[991aa6f]81 the best way to go.</para>
82
83 <para>The mode of any files from this part of the book that you put in
[e0d33ef]84 <filename class="directory">/etc/skel</filename> should be writable only by
85 the owner. Also, since there is no telling what kind of sensitive information
[991aa6f]86 a user may eventually place in their copy of these files, you should
87 make them unreadable by "group" and "other".</para>
88
[e0d33ef]89 <para>You can also put other files in
[991aa6f]90 <filename class="directory">/etc/skel</filename> and
91 different permissions may be needed for them.</para>
92
93 <para>Decide which initialization files should be provided in every (or most)
94 new user's home directory. The decisions you make will affect what you
[e0d33ef]95 do in the next two sections, <xref linkend="postlfs-config-profile"/> and
[991aa6f]96 <xref linkend="postlfs-config-vimrc"/>. Some or all of those files will be
[e0d33ef]97 useful for <systemitem class="username">root</systemitem>, any
[991aa6f]98 already-existing users, and new users.</para>
99
100 <para>The files from those sections that you might want to place in
101 <filename class="directory">/etc/skel</filename> include
102 <filename>.inputrc</filename>, <filename>.bash_profile</filename>,
103 <filename>.bashrc</filename>, <filename>.bash_logout</filename>,
104 <filename>.dircolors</filename>, and <filename>.vimrc</filename>. If
105 you are unsure which of these should be placed there, just continue to
106 the following sections, read each section and any references provided,
107 and then make your decision.</para>
108
109 <para>You will run a slightly modified set of commands for files which
[e0d33ef]110 are placed in <filename class="directory">/etc/skel</filename>. Each section
111 will remind you of this. In brief, the book's commands have been written for
112 files <emphasis>not</emphasis> added to
113 <filename class="directory">/etc/skel</filename> and just send the results to
114 the user's home directory. If the file is going to be in
115 <filename class="directory">/etc/skel</filename>, change the book's command(s)
[991aa6f]116 to send output there instead and then just copy the file from
[e0d33ef]117 <filename class="directory">/etc/skel</filename> to the appropriate
118 directories, like <filename class="directory">/etc</filename>,
119 <filename class="directory">~</filename> or the home directory
[991aa6f]120 of any other user already in the system.</para>
121
122 <bridgehead renderas="sect5">When Adding a User</bridgehead>
123
124 <para>When adding a new user with <command>useradd</command>, use
125 the <option>-m</option> parameter, which tells
126 <command>useradd</command> to create the user's home directory and
[e0d33ef]127 copy files from <filename class="directory">/etc/skel</filename> (can be
[991aa6f]128 overridden) to the new user's home directory. For example:</para>
129
130<screen role="root"><userinput>useradd -m <replaceable>[newuser]</replaceable></userinput></screen>
[9a67723]131
132</sect1>
Note: See TracBrowser for help on using the repository browser.