Monday, December 10, 2012

Modifying default template for user settings in Linux

If you wish to put or modify a standard template when creating new users, you may wish to put them in the /etc/skel. The /etc/skel acts as a containers where you can out the typical .bashrc .bash_profile .bash_profile or other scripts that you would want all the default users should have. In CentOS, you would typically see

drwxr-xr-x   3 root root  4096 Oct 31 13:12 .
drwxr-xr-x 126 root root 12288 Dec 11 22:48 ..
-rw-r--r--   1 root root    33 Jan 22  2009 .bash_logout
-rw-r--r--   1 root root   290 Oct 31 13:12 .bash_profile
-rw-r--r--   1 root root   176 Jan 22  2009 .bash_profile.old
-rw-r--r--   1 root root   461 Oct 31 13:12 .bashrc
-rw-r--r--   1 root root   124 Jan 22  2009 .bashrc.old
-rw-r--r--   1 root root   515 Jun 15  2008 .emacs
drwxr-xr-x   4 root root  4096 Sep  9  2010 .mozilla
-rw-r--r--   1 root root   658 Sep 22  2009 .zshrc

Do when you do a useradd, you will invoke the following workflow Default values used by useradd command  and inclusion of the template found in /etc/skel

No comments: