Importance Of /etc/skel Directory
/etc/skel directory contains a copy of all the necessary configuration files for users. When we create a new user account using useradd, whatever files present in /etc/skel are automatically copied to the user’s home directory which has been created.
Some common files which are present in the /etc/skel directory
/etc/skel files are hidden, so you need to use "ls -al" to see them
/etc/skel directory contains a copy of all the necessary configuration files for users. When we create a new user account using useradd, whatever files present in /etc/skel are automatically copied to the user’s home directory which has been created.
Some common files which are present in the /etc/skel directory
/etc/skel files are hidden, so you need to use "ls -al" to see them
Working of /etc/skel
Create a user called sample1, list his home directory, then we can see the copy of all files that are present in the /etc/skel
Create a user called sample1, list his home directory, then we can see the copy of all files that are present in the /etc/skel
What happens when we remove all those .bash files from sample1's home directory.?
Removing all the .bash files.
Removing all the .bash files.
Switch to the user sample1 after removing all .bash files from his home directory.
You can see a "-bash-4.1s" in the prompt.
Fixing the issue
Copy all .bash files from /etc/skel to /home/sample1.
Fixing the issue
Copy all .bash files from /etc/skel to /home/sample1.
Exit and switch back to the user sample1. Then you can see that everything is working perfectly.