source: postlfs/config/skel.xml@ 1ea79a1

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_1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 1ea79a1 was 1ea79a1, checked in by Bruce Dubbs <bdubbs@…>, 20 years ago

Typos and punctuation

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

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