source: postlfs/config/skel.xml@ 1dad4a4

10.0 10.1 11.0 6.0 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 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk v5_1 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 1dad4a4 was 1ea79a1, checked in by Bruce Dubbs <bdubbs@…>, 18 years ago

Typos and punctuation

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

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