source: postlfs/config/skel.xml@ 8bb9b01e

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 8bb9b01e was 6732c094, checked in by Randy McMurchy <randy@…>, 17 years ago

Updated all the XML files (and the one stylesheet) to use the 4.5 version of DocBook XML DTD

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

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