Human Readable   

 

     
   
     

A Slackware Desktop Enhancement Guide

Creating a Nominal /etc/skel Directory

© Copyright Darrell Anderson.

Slackware comes packaged with an /etc/skel directory but no files stored within that directory. Many new GNU/Linux users probably cannot appreciate the purpose of this directory until they begin creating new user accounts and initially want to configure all of those accounts in a similar fashion. The /etc/skel directory exists for that purpose.

When adding new user accounts, and if configured properly, the useradd command will copy to the new user’s home directory all files located in the /etc/skel directory. Using this method administrators easily can populate a new user’s home directory with certain files, such as the bash startup files, or basic configuration files.

Enabling this process requires two steps. Step one is to configure the useradd command defaults to use the /etc/skel directory when creating new accounts. By design the /etc/skel directory is where the useradd command will look for files.

Step two is to copy all desired files to the /etc/skel directory.

Like so much with Slackware, creating the initial useradd defaults is a manual but straightforward process. The useradd command comes built with certain defaults. To learn of those defaults, at a command line type useradd -D. The output will look something like this:

GROUP=100
HOME=/home/users
INACTIVE=-1
EXPIRE=
SHELL=
SKEL=/etc/skel

Notice, however, that no default shell is defined. To remedy that problem create the /etc/default/useradd file and supply the desired information. Modified defaults are stored in a text file located at /etc/default/useradd. As is typical with Slackware, this file does not initially exist. Quickly create that file by redirecting the output of useradd -D:

useradd -D > /etc/default/useradd

The format of that file is the same as the console screen output. Edit and save the text file to add a default shell:

GROUP=100
HOME=/home/users
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel

Then populate the /etc/skel directory. Consider a sampling of the files that administrators might want to copy to /etc/skel:

.kde (directory)
.qt (directory)
tmp (directory)
.bash_profile
.bashrc
.bash_logout
.dmrc
.face.icon
.gtkrc-2.0
.hushlogin
.viminfo
.vimrc

Once the /etc/skel directory is populated, and the useradd command is properly configured, adding new user accounts becomes a wee bit less of a chore.

An additional note, Slackware provides a special command line script called adduser that is located in /usr/sbin. Yes, the similarity in names is confusing! The adduser script is basically a front-end to the useradd command. Whenever in doubt about which one to use, however, at the command line type man useradd or man adduser. The script is packaged with no man page.

Lastly, KDE comes packaged with a nice graphical user manager tool called KUser. In most KDE menus the utility is found in the System menu.

Finis.

Table of Contents