source: postlfs/config/skel.xml@ 0290a023

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 0290a023 was 0290a023, checked in by Randy McMurchy <randy@…>, 19 years ago

Indexed configuration files and bootscripts in the 'After LFS Configuration Issues' section

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

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