🌐 🇵🇱 Polski · 🇬🇧 EN
We have already discussed creating user accounts and groups. Now, let's go a step further into the process and see what actually happens when a new account is created. When we create a new user account, everything from the /etc/skel directory is copied to the newly created user home directory, i.e., /home/<username>. You can modify the default skeleton by adding your own directories and files. The benefit of this solution is a standardized home directory layout in accordance with established policies. Configuration files can be managed in two different sections:
- user-specific specification
- system-wide specification
USER-SPECIFIC SPECIFICATION
After creating a user and copying their files from the template, we can configure them as needed. There are three files that allow for configuration:
- ~/.bashrc - Definition of functions and aliases
- ~/.bash_profile - Environment variable settings
- ~/bash_logout - Definition of commands to be executed upon user logout
The above settings can be unique to each user, are stored in the user's home directory, and are intended for that specific user. But what if a user has already been working in the system for some time, or if we want to implement settings for everyone?
GLOBAL USER SETTINGS
You can also edit and change the default settings for users in three files:
- /etc/bashrc - Definition of functions and aliases
- /etc/profle - Environment variable settings
- /etc/profile.d - Settings for directories containing scripts that reference /etc/profile
These settings allow you to provide users with everything they need to start working with the system. If you want to change something for everyone, you just need to do it in the global configuration files rather than in the local versions for each user.
The last file you should familiarize yourself with is /etc/login.defs. This file controls system users.
# grep -v ^# /etc/login.defs
MAIL_DIR /var/spool/mail
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_MIN_LEN 5
PASS_WARN_AGE 7
UID_MIN 500
UID_MAX 60000
GID_MIN 500
GID_MAX 60000
CREATE_HOME yes
UMASK 077
USERGROUPS_ENAB yes
MD5_CRYPT_ENAB yes
The values found here are appropriate, but you can modify them if you wish. Global configuration files definitely speed up the user setup process in the initial phase of their work with the system and limit the work to settings in one place for all users.
Comments