How To Create User Creation Defaults With Skel In Linux?

We want to create system default for user creation and addition. System defaults mean what will be default values for the user creation like home path, user id etc.

skel Directory

/etc/skel is the directory where files will be copied to the new user directory from here. If we look detailed we will see that there are some default files in it.

$ls -al /etc/skel/

All these .bashrc .bash_logout and .bash_profile files will be copied newly created user home directory.

.bashrc is the start file when a new shell is opened it will run. For example if we want to run some command while opening new shell or we want to set some environment variables we will add them to this files.

.bash_profile is the file which will call .bashrc file and set some PATH environment

Create Some File In Skel

Keep i mind that to create files in skel we need root privileges. If we want to set some mail related environment variables we can edit .bash_profile file like below.

$echo "mail=" >> /etc/skel/.bashrc

LEARN MORE  Linux Su Command Tutorial With Examples

Leave a Comment