source: postlfs/config/skel.xml@ 65e7508

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 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 65e7508 was 65e7508, checked in by Larry Lawrence <larry@…>, 20 years ago

remove inputrc chapter

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

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