Ignore:
Timestamp:
08/22/2003 03:37:27 PM (21 years ago)
Author:
Larry Lawrence <larry@…>
Branches:
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
Children:
0108c1d
Parents:
71f73f0f
Message:

Added Bill's patch to postlfs

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/config/skel.xml

    r71f73f0f rcfc2a54  
    11<sect1 id="postlfs-config-skel">
    22<?dbhtml filename="skel.html" dir="postlfs"?>
    3 <title>/etc/skel</title>
     3<title>Configuring for Adding Users</title>
    44
    5 <para>The <filename>/etc/skel</filename> directory is quite simple
    6 to setup and use.  It provides a way to make sure that all new users on
    7 your LFS system begin with the same settings.  The
    8 <filename>/etc/skel</filename> directory is used by the
    9 <filename>/usr/sbin/useradd</filename> program.</para>
     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>
    1012
    11 <para>For more information see <userinput>man useradd</userinput>.</para>
     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>
    1218
    13 <para>To get started create a <filename>/etc/skel</filename> directory.
    14 Creating the directory as root is the best way to go.  Next copy any
    15 files into <filename>/etc/skel</filename> that you want every new user
    16 to have placed in their home drive.  Examples include
    17 <filename>.bash_profile</filename>, <filename>.bashrc</filename>,
    18 <filename>.bash_logout</filename>, <filename>dircolors</filename>,
    19 <filename>.inputrc</filename> and <filename>.vimrc</filename>.</para>
     19<para>Useradd</para>
    2020
    21 <para>When creating a new user with
    22 <filename>/usr/sbin/useradd</filename> use the <userinput>-m</userinput>
    23 parameter.  For example:</para>
    24 
    25 <para><screen><userinput>useradd -m -s/bin/bash jwrober</userinput></screen></para>
    26 
    27 <para>The <filename>/usr/sbin/useradd</filename> program uses a
    28 collection of default values.  It will read them from the
    29 <filename>/etc/default/useradd</filename> file if it exists.  If the
    30 file does not exist, then it uses some internal defaults.  They can be
    31 found by running <userinput>/usr/sbin/useradd -D</userinput>.</para>
     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>
    3227
    3328<para>To change these values to something new, create a base
     
    5348
    5449<para>This will set the <userinput>SHELL=</userinput> line to
    55 <userinput>SHELL=/bin/bash</userinput>.  This makes it even easier to
    56 add new users to your LFS system.  The
    57 <filename>/usr/sbin/useradd</filename> has many parameters that can be
    58 set in the <filename>/etc/default/useradd</filename> file.  See the man
    59 page for more details.</para>
     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>
    60110
    61111</sect1>
Note: See TracChangeset for help on using the changeset viewer.