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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Linux OS Service ‘rpcgssd’
  2. How to enable/disable SELinux Modes in RHEL/CentOS
  3. How to Create a Custom Log File Rotation by logrotate in Linux
  4. CentOS / RHEL : How to add swap file
  5. mdadm: Cannot open /dev/sda1: Device or resource busy
  6. CentOS / RHEL 5, 6 : how to disable NetworkManager
  7. CentOS / RHEL : How to block incoming and outgoing ports using iptables
  8. CentOS / RHEL 6,7 : How to disable or delete virbr0 interface
  9. How to add or delete a samba user under Linux
  10. How to query and modify kernel parameters using sysctl (Immediately and persistently) in CentOS / RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • How Realms Work in Oracle Database Vault
  • How to use Privilege Analysis in Oracle Database
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary