source: postlfs/config/skel.xml@ cfc2a54

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 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 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since cfc2a54 was cfc2a54, checked in by Larry Lawrence <larry@…>, 21 years ago

Added Bill's patch to postlfs

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

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