Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views2 pages

User and Group

The document provides an overview of user and group management in Linux, detailing essential commands for creating, deleting, and listing users and groups. It also covers setting passwords, switching users, and managing file permissions. These commands are crucial for maintaining system security and organization of resources.

Uploaded by

murshidg076
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

User and Group

The document provides an overview of user and group management in Linux, detailing essential commands for creating, deleting, and listing users and groups. It also covers setting passwords, switching users, and managing file permissions. These commands are crucial for maintaining system security and organization of resources.

Uploaded by

murshidg076
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

In Linux, user and group management is essential for managing system security, access

permissions, and overall organization of resources. Here’s an overview of common commands


and tasks involved in managing users and groups.
1. Managing Users
• Creating a User
sudo adduser username
This command creates a new user along with a home directory and sets initial configurations.
• Deleting a User
sudo deluser username.
• Listing Users
Users are listed in the /etc/passwd file. You can view it with:
cat /etc/passwd
2. Managing Groups
• Creating a Group
sudo addgroup groupname
• Adding a User to a Group
sudo usermod -aG groupname username
The -aG option adds the user to the group without affecting their other group memberships.
• Deleting a Group
sudo delgroup groupname
• Listing Groups
Groups are listed in the /etc/group file:
cat /etc/group
3. Setting Passwords and Permissions
• Setting/Changing a User Password
sudo passwd username
• Viewing User and Group Information
o To view detailed information about a user:
id username
4. Switching Users
• Switch to Another User
su - username
To return to the original user, type exit.
5. Managing Permissions
• Changing Ownership with chown
Change file ownership to a specific user and group:
sudo chown user:group filename
With these commands, you can manage users, groups, and permissions effectively in a Linux
environment.

You might also like