2002-12-24 11:01:04 +08:00
|
|
|
<sect1 id="postlfs-config-skel">
|
|
|
|
<?dbhtml filename="skel.html" dir="postlfs"?>
|
|
|
|
<title>/etc/skel</title>
|
|
|
|
|
2003-01-01 06:00:02 +08:00
|
|
|
<para>The <filename>/etc/skel</filename> directory is quite simple
|
|
|
|
to setup and use. It provides a way to make sure that all new users on
|
|
|
|
your LFS system begin with the same settings. The
|
|
|
|
<filename>/etc/skel</filename> directory is used by the
|
|
|
|
<filename>/usr/sbin/useradd</filename> program.</para>
|
2002-12-24 11:01:04 +08:00
|
|
|
|
2003-04-05 21:54:02 +08:00
|
|
|
<para>For more information see <userinput>man useradd</userinput>.</para>
|
2003-01-01 06:00:02 +08:00
|
|
|
|
|
|
|
<para>To get started create a <filename>/etc/skel</filename> directory.
|
|
|
|
Creating the directory as root is the best way to go. Next copy any
|
|
|
|
files into <filename>/etc/skel</filename> that you want every new user
|
|
|
|
to have placed in their home drive. Examples include
|
|
|
|
<filename>.bash_profile</filename>, <filename>.bashrc</filename>,
|
|
|
|
<filename>.bash_logout</filename>, <filename>dircolors</filename>,
|
|
|
|
<filename>.inputrc</filename>, and <filename>.vimrc</filename>.</para>
|
|
|
|
|
|
|
|
<para>When creating a new user with
|
|
|
|
<filename>/usr/sbin/useradd</filename> use the <userinput>-m</userinput>
|
|
|
|
parameter. For example:</para>
|
|
|
|
|
2003-04-05 21:54:02 +08:00
|
|
|
<para><screen><userinput>useradd -m -s/bin/bash jwrober</userinput></screen></para>
|
2003-01-01 06:00:02 +08:00
|
|
|
|
|
|
|
<para>The <filename>/usr/sbin/useradd</filename> program uses a
|
|
|
|
collection of default values. It will read them from the
|
|
|
|
<filename>/etc/default/useradd</filename> file if it exists. If the
|
|
|
|
file does not exist, then it uses some internal defaults. They can be
|
|
|
|
found by running <userinput>/usr/sbin/useradd -D</userinput>.</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 <userinput>/usr/sbin/useradd -D</userinput>. Here is a
|
|
|
|
sample.</para>
|
|
|
|
|
|
|
|
<para><screen># Begin /etc/default/useradd
|
|
|
|
|
|
|
|
GROUP=100
|
|
|
|
HOME=/home
|
|
|
|
INACTIVE=-1
|
|
|
|
EXPIRE=
|
|
|
|
SHELL=
|
|
|
|
SKEL=/etc/skel
|
|
|
|
|
|
|
|
# End /etc/default/useradd</screen></para>
|
|
|
|
|
|
|
|
<para>The only thing missing from the file is a default shell. Add that
|
|
|
|
by running:</para>
|
|
|
|
|
2003-04-05 05:34:47 +08:00
|
|
|
<para><screen><userinput>/usr/sbin/useradd -D -s/bin/bash</userinput></screen></para>
|
2003-01-01 06:00:02 +08:00
|
|
|
|
|
|
|
<para>This will set the <userinput>SHELL=</userinput> line to
|
|
|
|
<userinput>SHELL=/bin/bash</userinput>. This makes it even easier to
|
|
|
|
add new users to your LFS system. The
|
|
|
|
<filename>/usr/sbin/useradd</filename> has many parameters that can be
|
|
|
|
set in the <filename>/etc/default/useradd</filename> file. See the man
|
|
|
|
page for more details.</para>
|
2002-12-24 11:01:04 +08:00
|
|
|
|
|
|
|
</sect1>
|