Tagged skel.xml

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@4178 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
Manuel Canales Esparcia 2005-05-12 21:33:14 +00:00
parent 5a1ffddc81
commit 991aa6f2a6

View File

@ -6,44 +6,48 @@
]>
<sect1 id="postlfs-config-skel" xreflabel="Configuring for Adding Users">
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<?dbhtml filename="skel.html"?>
<title>Configuring for Adding Users</title>
<indexterm zone="postlfs-config-skel">
<primary sortas="e-etc-skel">/etc/skel/*</primary></indexterm>
<indexterm zone="postlfs-config-skel">
<primary sortas="e-etc-default-useradd">/etc/default/useradd</primary>
</indexterm>
<?dbhtml filename="skel.html"?>
<para>Together, the <command>/usr/sbin/useradd</command> command and
<filename class="directory">/etc/skel</filename> directory (both are easy to
setup and use) provide a way to assure new users are added on your
<acronym>LFS</acronym> system with the same beginning settings for things
like <envar>PATH</envar>, keyboard processing and environmental variables.
Using these two facilities makes it easier to assure this initial state for
each new user.</para>
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<para>The <filename class="directory">/etc/skel</filename> directory holds
copies of various initialization and other files that may be copied to the
new user's home directory when the <command>/usr/sbin/useradd</command>
program adds the new user.</para>
<title>Configuring for Adding Users</title>
<para><emphasis>Useradd</emphasis></para>
<indexterm zone="postlfs-config-skel">
<primary sortas="e-etc-skel">/etc/skel/*</primary>
</indexterm>
<para>The <command>useradd</command> program uses a collection of
default values kept in <filename>/etc/default/useradd</filename>,
if it exists. If the file does not exist, then it uses some internal
defaults. You can see the default values by running
<command>/usr/sbin/useradd -D</command>.</para>
<indexterm zone="postlfs-config-skel">
<primary sortas="e-etc-default-useradd">/etc/default/useradd</primary>
</indexterm>
<para>To change these values to something new, create a base <filename>
/etc/default/useradd</filename> file with the same values as the output of
<command>/usr/sbin/useradd -D</command>. Here is a sample.</para>
<para>Together, the <command>/usr/sbin/useradd</command> command and
<filename class="directory">/etc/skel</filename> directory (both are easy to
setup and use) provide a way to assure new users are added on your LFS
system with the same beginning settings for things like <envar>PATH</envar>,
keyboard processing and environmental variables. Using these two facilities
makes it easier to assure this initial state for each new user.</para>
<screen># Begin /etc/default/useradd
<para>The <filename class="directory">/etc/skel</filename> directory holds
copies of various initialization and other files that may be copied to the
new user's home directory when the <command>/usr/sbin/useradd</command>
program adds the new user.</para>
<bridgehead renderas="sect5">Useradd</bridgehead>
<para>The <command>useradd</command> program uses a collection of
default values kept in <filename>/etc/default/useradd</filename>,
if it exists. If the file does not exist, then it uses some internal
defaults. You can see the default values by running
<command>/usr/sbin/useradd -D</command>.</para>
<para>To change these values to something new, create a base <filename>
/etc/default/useradd</filename> file with the same values as the output of
<command>/usr/sbin/useradd -D</command>. Here is a sample.</para>
<screen><literal># Begin /etc/default/useradd
GROUP=100
HOME=/home
@ -52,74 +56,77 @@ EXPIRE=
SHELL=
SKEL=/etc/skel
# End /etc/default/useradd</screen>
# End /etc/default/useradd</literal></screen>
<para>The only thing missing from the file is a default shell. Add that
by running:</para>
<para>The only thing missing from the file is a default shell. Add that
by running:</para>
<screen><userinput><command>/usr/sbin/useradd -D -s/bin/bash</command></userinput></screen>
<screen role="root"><userinput>/usr/sbin/useradd -D -s/bin/bash</userinput></screen>
<para>This will set the <envar>SHELL</envar>= line to
<envar>SHELL</envar>=/bin/bash.</para>
<para>This will set the <envar>SHELL</envar>= line to
<envar>SHELL</envar>=/bin/bash.</para>
<para><command>Useradd</command> has many parameters that
can be set in the <filename>/etc/default/useradd</filename> file.</para>
<para><command>Useradd</command> has many parameters that
can be set in the <filename>/etc/default/useradd</filename> file.</para>
<para>For more information see <command>man useradd</command>.</para>
<para>For more information see <command>man useradd</command>.</para>
<para><emphasis>/etc/skel</emphasis></para>
<bridgehead renderas="sect5">/etc/skel</bridgehead>
<para>To get started, create an
<filename class="directory">/etc/skel</filename> directory and make sure it is
writable only by the system administrator, usually root. Creating the
directory as root is the best way to go.</para>
<para>To get started, create an <filename
class="directory">/etc/skel</filename> directory and make sure it is
writable only by the system administrator, usually <systemitem
class="username">root</systemitem>. Creating the
directory as <systemitem class="username">root</systemitem> is
the best way to go.</para>
<para>The mode of any files from this part of the book that you put in
<filename class="directory">/etc/skel</filename> should be writable only by
the owner. Also, since there is no telling what kind of sensitive information
a user may eventually place in their copy of these files, you should
make them unreadable by "group" and "other".</para>
<para>The mode of any files from this part of the book that you put in
<filename class="directory">/etc/skel</filename> should be writable only by
the owner. Also, since there is no telling what kind of sensitive information
a user may eventually place in their copy of these files, you should
make them unreadable by "group" and "other".</para>
<para>You can also put other files in
<filename class="directory">/etc/skel</filename> and
different permissions may be needed for them.</para>
<para>You can also put other files in
<filename class="directory">/etc/skel</filename> and
different permissions may be needed for them.</para>
<para>Decide which initialization files should be provided in every (or most)
new user's home directory. The decisions you make will affect what you
do in the next two sections, <xref linkend="postlfs-config-profile"/> and
<xref linkend="postlfs-config-vimrc"/>. Some or all of those files will be
useful for root, any already-existing users, and new users.</para>
<para>Decide which initialization files should be provided in every (or most)
new user's home directory. The decisions you make will affect what you
do in the next two sections, <xref linkend="postlfs-config-profile"/> and
<xref linkend="postlfs-config-vimrc"/>. Some or all of those files will be
useful for <systemitem class="username">root</systemitem>, any
already-existing users, and new users.</para>
<para>The files from those sections that you might want to place in
<filename class="directory">/etc/skel</filename> include
<filename>.inputrc</filename>, <filename>.bash_profile</filename>,
<filename>.bashrc</filename>, <filename>.bash_logout</filename>,
<filename>.dircolors</filename>, and <filename>.vimrc</filename>. If
you are unsure which of these should be placed there, just continue to
the following sections, read each section and any references provided,
and then make your decision.</para>
<para>The files from those sections that you might want to place in
<filename class="directory">/etc/skel</filename> include
<filename>.inputrc</filename>, <filename>.bash_profile</filename>,
<filename>.bashrc</filename>, <filename>.bash_logout</filename>,
<filename>.dircolors</filename>, and <filename>.vimrc</filename>. If
you are unsure which of these should be placed there, just continue to
the following sections, read each section and any references provided,
and then make your decision.</para>
<para>You will run a slightly modified set of commands for files which
are placed in <filename class="directory">/etc/skel</filename>. Each section
will remind you of this. In brief, the book's commands have been written for
files <emphasis>not</emphasis> added to
<filename class="directory">/etc/skel</filename> and just send the results to
the user's home directory. If the file is going to be in
<filename class="directory">/etc/skel</filename>, change the book's command(s)
to send output there instead and then just copy the file from
<filename class="directory">/etc/skel</filename> to the appropriate
directories, like <filename class="directory">/etc</filename>,
<filename class="directory">~</filename> or the home directory
of any other user already in the system.</para>
<para>You will run a slightly modified set of commands for files which
are placed in <filename class="directory">/etc/skel</filename>. Each section
will remind you of this. In brief, the book's commands have been written for
files <emphasis>not</emphasis> added to
<filename class="directory">/etc/skel</filename> and just send the results to
the user's home directory. If the file is going to be in
<filename class="directory">/etc/skel</filename>, change the book's command(s)
to send output there instead and then just copy the file from
<filename class="directory">/etc/skel</filename> to the appropriate
directories, like <filename class="directory">/etc</filename>,
<filename class="directory">~</filename> or the home directory
of any other user already in the system.</para>
<para><emphasis>When Adding a User</emphasis></para>
<bridgehead renderas="sect5">When Adding a User</bridgehead>
<para>When adding a new user with <command>useradd</command>, use
the <option>-m</option> parameter, which tells
<command>useradd</command> to create the user's home directory and
copy files from <filename class="directory">/etc/skel</filename> (can be
overridden) to the new user's home directory. For example:</para>
<para>When adding a new user with <command>useradd</command>, use
the <option>-m</option> parameter, which tells
<command>useradd</command> to create the user's home directory and
copy files from <filename class="directory">/etc/skel</filename> (can be
overridden) to the new user's home directory. For example:</para>
<screen><command>useradd -m jwrober</command></screen>
<screen role="root"><userinput>useradd -m <replaceable>[newuser]</replaceable></userinput></screen>
</sect1>