/etc/skel directory in Linux
1 min readMay 17, 2019
- skel is derived from the skeleton because it contains basic structure of home directory
- The /etc/skel directory contains files and directories that are automatically copied over to a new user’s when it is created from useradd command.
- This will ensure that all the users gets same intial settings and environment.
ls -la /etc/skel/total 24drwxr-xr-x. 2 root root 62 Apr 11 2018 .drwxr-xr-x. 77 root root 2880 Mar 28 03:38 ..-rw-r--r--. 1 root root 18 May 30 17:07 .bash_logout-rw-r--r--. 1 root root 193 May 30 17:07 .bash_profile-rw-r--r--. 1 root root 231 May 30 17:07 .bashrc
- The location of /etc/skel can be changed by editing the line that begins with SKEL= in the configuration file /etc/default/useradd. By default this line says SKEL=/etc/skel.
cat /etc/default/useradd# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes
- Default Permission of the /etc/skel directory is drwxr-xr-x.
- It is not recommended to change the permission of skel directory or its contents. 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 stop work or not works as expected.
That’s it
Happy Learning