• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Understanding the /etc/skel directory in Linux

by admin

The skel directory

Directory /etc/skel/ (skel is derived from the “skeleton”) is used to initiate home directory when a user is first created. A sample layout of “skeleton” user files is as shown below:

# ls -lart /etc/skel
total 32
drwxr-xr-x    4 root root  4096 Feb  4  2016 .mozilla
-rw-r--r--    1 root root   124 Feb 15  2017 .bashrc
-rw-r--r--    1 root root   176 Feb 15  2017 .bash_profile
-rw-r--r--    1 root root    18 Feb 15  2017 .bash_logout
drwxr-xr-x.   3 root root  4096 Aug 22  2017 .
drwxr-xr-x. 112 root root 12288 Feb 26 03:09 ..
Note: “skeleton” directory is defined in /etc/default/useradd file.

Below is a sample /etc/defualt/useradd file which defines the skel directory. You can change the default location /etc/skel to any other location.

# cat /etc/default/useradd
# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes

You can also change the default base home directory (which is “/home” in the above example) to any other location.

Default permission of /etc/skel directory

– Default permission of /etc/skel is drwxr-xr-x.
– It is not recommended to change the permission of skel directory or its contents. Changing the permission may possibly break some of the program, because in skel directory there are some profiles that needs the permission of read and trying to give it permission of execute will cause some programs/profiles to work unexpectedly.

How to restore files under user’s home directory to default in Linux

Filed Under: Linux

Some more articles you might also be interested in …

  1. quotaoff Command Examples in Linux
  2. gcov Command Examples in Linux
  3. nohup: command not found
  4. Linux Command line Basics – Executing commands from the command line
  5. a2enconf: command not found
  6. adduser Command Examples in Linux
  7. How to make CentOS/RHEL 7 FIPS 140-2 compliant
  8. Linux OS Service ‘anacron’
  9. How to Recover Corrupted Root Partition from Rescue Mode in CentOS/RHEL 5,6
  10. shred Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright