source: postlfs/config/skel.xml@ 65e7508

10.0 10.1 11.0 11.1 11.2 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 krejzi/svn lazarus nosym perl-modules plabs/python-mods qt5new systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since 65e7508 was 65e7508, checked in by Larry Lawrence <larry@…>, 18 years ago

remove inputrc chapter

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