Setting defaults for new users on a Linux system
To set defaults for new users on your Linux system, the /etc/skel folder will come into play. You may place the .bash_profile, .bashrc & .bash_logout files that set defaults for the user such as the BASH shell prompt, and the logout and login options. This is a great way to customise your Linux user experience if your system will have many users, as Linux is a multi-user operating system this shows that the users may all share the same defaults. When you add a user with the useradd command it copies the files from the /etc/skel folder to set up the user. You may also create sample folders within the /etc/skel folder such as ~/Desktop, ~/Documents, ~/Pictures and ~/Downloads. This is how a Linux distribution sets up a user automatically when you create a new user, either using the GUI or the command-line useradd command.
The listing below shows the contents of the /etc/skel folder on Debian 6.0. You may place any configuration file such as .Xdefaults, .xsession or .xinitrc to set up the new user.
neo@deusexmachina:~$ ls -hula /etc/skel/ total 28K drwxr-xr-x 2 root root 4.0K Mar 27 19:28 . drwxr-xr-x 126 root root 12K Mar 27 19:28 .. -rw-r--r-- 1 root root 220 Mar 24 07:40 .bash_logout -rw-r--r-- 1 root root 3.1K Mar 24 07:40 .bashrc -rw-r--r-- 1 root root 675 Mar 24 07:40 .profile |
These files will be placed in the user`s home directory when a new account is created, and this will ensure that defaults for the UNIX/Linux system will be transferred to that account. This is a very good time-saving measure when deploying a new server that will be logged into by many users. Subdirectories may be created in here as well, and they will be created in the users home directory, ready for use.