User and Group Management in Linux involves creating, managing, and assigning permissions to users and groups. This process is essential for controlling access to resources and ensuring a secure environment. Here’s a breakdown:
In Linux, a "user" represents an individual who can log into the system and interact with files and applications. Each user has a unique User ID (UID) and a home directory where personal files are stored.
www-data
for Apache).sudo useradd <username>
sudo userdel <username>
sudo passwd <username>
sudo usermod <options> <username>
Groups allow users to share permissions and access to files or resources collectively. Each user can belong to multiple groups, but one primary group.
sudo groupadd <groupname>
sudo groupdel <groupname>
sudo usermod -aG <groupname> <username>
cat /etc/group
File permissions are set for the owner (user), group, and others. Permissions include:
sudo chown <user>:<group> <filename>
chmod <mode> <filename>
sudo useradd -m -s /bin/bash <username>
sudo groupadd developers sudo usermod -aG developers <username>
By managing users and groups effectively, Linux administrators can control access to resources, implement security policies, and ensure that users have the appropriate permissions for their tasks.
@aCodeTutorials All Rights Reserved
privacy policy | about