Skip to main content

Posts

Showing posts from December, 2023

Crafting Groups with Precision: Mastering groupadd and gpasswd in Linux

In the realm of Linux, groups establish boundaries of control, defining who can access what resources. Navigating this realm effectively calls for mastery of two essential commands: groupadd and gpasswd. 1. groupadd: Architecting New Groups Purpose: Gracefully constructs new groups within your Linux system. Syntax: groupadd [options] group_name Common Options: -g GID: Explicitly assigns a specific group ID (GID). -r: Forges a system group, possessing a GID lower than 1000. Example: sudo groupadd developers (Establishes a new group named “developers”) 2. gpasswd: The Group’s Gatekeeper Purpose: Manipulates group membership, passwords, and administrative attributes. Syntax: gpasswd [options] group_name Common Options: -a user: Appends a user to the specified group. -d user: Revokes a user’s membership from the group. -A user1,user2…: Designates administrative members within the group. Example: sudo gpasswd -a john developers (Adds user “john” to the “developers” group) Practical Demonstr...

User Management in Linux

  Linux is a multi-user operating system, which means that multiple users can access the system and its resources simultaneously. User management is the process of creating, modifying, and deleting user accounts, as well as assigning them permissions and roles. In this post, we will cover some of the basic concepts and commands related to user management in Linux. /etc/passwd and /etc/shadow files The /etc/passwd and /etc/shadow files are two of the most important files for user management in Linux. They store the information about the users and their passwords, respectively. /etc/passwd file The /etc/passwd file contains one line for each user account, with the following format: username:x:uid:gid:comment:home:shell The fields are separated by colons, and they represent: username : The name of the user, which is used for logging in and identifying the user. x : A placeholder for the password, which is actually stored in the /etc/shadow file. uid : The user ID, which is a unique nu...