source: postlfs/config/skel.xml@ eb7ab87b

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 eb7ab87b was 9ed94cb, checked in by Larry Lawrence <larry@…>, 21 years ago

editor tagging

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@986 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 <command>/usr/sbin/useradd</command> 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
8<acronym>LFS</acronym> system with the
9same beginning settings for things like <envar>PATH</envar>, keyboard processing and
10environmental variables. Using these two facilities makes it easier to
11assure this initial state for each new user.
12</para>
13
14<para>
15The <filename>/etc/skel</filename> directory holds copies of various
16initialization and other files that may be copied to the new user's home
17directory when the <command>/usr/sbin/useradd</command>
18program adds the new user.</para>
19
20<para>Useradd</para>
21
22<para>The <command>useradd</command> program uses a collection of
23default values kept in <filename>/etc/default/useradd</filename>,
24if it exists. If the file does not exist, then it uses some internal
25defaults. You can see the default values by running
26<userinput><command>/usr/sbin/useradd -D</command></userinput>.
27</para>
28
29<para>To change these values to something new, create a base
30<filename>/etc/default/useradd</filename> file with the same values as
31the output of <userinput><command>/usr/sbin/useradd -D</command></userinput>. Here is a
32sample.</para>
33
34<screen># Begin /etc/default/useradd
35
36GROUP=100
37HOME=/home
38INACTIVE=-1
39EXPIRE=
40SHELL=
41SKEL=/etc/skel
42
43# End /etc/default/useradd</screen>
44
45<para>The only thing missing from the file is a default shell. Add that
46by running:</para>
47
48<screen><userinput><command>/usr/sbin/useradd -D -s/bin/bash</command></userinput></screen>
49
50<para>This will set the <envar>SHELL</envar>= line to
51<envar>SHELL</envar>=/bin/bash.</para>
52
53<para><command>Useradd</command> has many parameters that
54can be set in the <filename>/etc/default/useradd</filename> file.
55</para>
56
57<para>For more information see <command>man useradd</command>.</para>
58
59<para>/etc/skel</para>
60
61<para>To get started create an <filename>/etc/skel</filename> directory
62and make sure it is writable only by the system administrator, usually
63root. Creating the directory as root is the best way to go.</para>
64
65<para>The mode of any files from this part of the book that you put in
66<filename>/etc/skel</filename> should be writable only by the owner.
67Also, since there is no telling what kind of sensitive information a
68user may eventually place in their copy of these files, you should
69make them unreadable by "group" and "other".</para>
70
71<para>You can also put other files in <filename>/etc/skel</filename> and
72different permissions may be needed for them.
73</para>
74
75<para>
76Decide which initialization files should be provided in every (or most)
77new user's home directory. The decisions you make will affect what you
78do in the next three sections, "/etc/inputrc", "The Bash Shell Startup
79Files" and "/etc/vimrc, ~/.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>/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>/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>/etc/skel</filename> and
95just send the results to the user's home directory. If the file is going
96to be in <filename>/etc/skel</filename>, change the book's command(s) to
97send output there instead and then just copy the file from
98<filename>/etc/skel</filename> to the appropriate directories, like
99<filename>/etc</filename>, <filename>~</filename> or the home directoriy
100of any other user already in the system.</para>
101
102<para>When Adding a User</para>
103
104<para>When adding a new user with <filename>useradd</filename> use
105the <userinput>-m</userinput> parameter, which tells
106<filename>useradd</filename> to create the user's home directory and
107copy files from <filename>/etc/skel</filename> (can be overridden) to
108the new user's home directory. For example:</para>
109
110<screen><command>useradd -m -s/bin/bash jwrober</command></screen>
111
112</sect1>
Note: See TracBrowser for help on using the repository browser.