Linux user management is an essential part of administering a Linux system. It involves creating, modifying, and managing user accounts, groups, and permissions.
Key aspects of Linux user management:
User Accounts:
useradd
command followed by the username. For example:
sudo useradd newuser
userdel
command with the -r
option to remove the user's home directory and files:
sudo userdel -r username
User Properties:
usermod
command:
sudo usermod -d /new/home/directory -s /bin/bash newuser
Password Management:
passwd
command to set or change a user's password:
sudo passwd username
/etc/security/pwquality.conf
file or configure PAM modules.Group Management:
groupadd
command:
sudo groupadd newgroup
usermod
command:
sudo usermod -aG groupname username
User Privileges:
sudo
command. Modify the /etc/sudoers
file with the visudo
command:
sudo visudo
File and Directory Permissions:
chmod
, chown
, and chgrp
commands to manage file and directory permissions:
chmod permissions filename
chown owner:group filename
Home Directories:
/home/username
. It's where users store their personal files and configurations.Account Locking and Expiry:
sudo passwd -l username
chage
command:
sudo chage -E 2023-12-31 username
User Environment:
~/.bashrc
and ~/.bash_profile
.Authentication:
/etc/pam.d/common-auth
or through PAM modules.Monitoring and Auditing:
/var/log/auth.log
) for any suspicious activities related to user accounts.Graphical Tools:
Remember to manage user accounts securely, enforce strong password policies, and regularly audit and monitor user activities to maintain the security and integrity of your Linux system.