source: postlfs/config/skel.xml@ f8d632a

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 xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since f8d632a was f8d632a, checked in by Bruce Dubbs <bdubbs@…>, 17 years ago

New XML Chapter 3

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

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