source: postlfs/config/skel.xml@ 7f76b96

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 7f76b96 was 7f76b96, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Reverted the DTD change. That don't be done untiltomorrow.

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

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