🚀 Day 4 of My DevOps Journey : Linux User and Group Management

Table of contents

Posted on July 9, 2025 | By Ritesh Singh
Hello, Hashnode community! 👋 I'm Ritesh, a budding DevOps engineer documenting my learning journey as I dive into Linux and DevOps practices. On Day 4 of my DevOps journal, I focused on Linux User and Group Management—a critical skill for securing systems and enabling team collaboration. In this blog, I’ll share my hands-on experience, practical commands, and tips to help fellow beginners kickstart their DevOps journey. Let’s get started! 🚀
Why Linux User and Group Management?
As a DevOps enthusiast, I’ve learned that Linux is the backbone of most server infrastructure. Mastering user and group management is essential for:
Securing servers by controlling access.
Enabling collaboration through shared group permissions.
Building a foundation for advanced DevOps tasks like automation and containerization.
This knowledge is a stepping stone for certifications like Certified Kubernetes Administrator (CKA) or Red Hat Certified Engineer (RHCE), which I’m eyeing for my DevOps career.
📘 Day 4: Linux User and Group Management
On Day 4, I explored how to manage users and groups in Linux, practicing commands to create secure, collaborative environments. Here’s what I learned:
👤 Creating and Managing Users
To create a user named ravi
with a home directory and password:
sudo adduser ravi
sudo passwd ravi
adduser
: Creates the user, sets up a home directory (/home/ravi
), and assigns a default group.passwd
: Sets a secure password forravi
.
🔁 Switching Users and Verifying Identity
To test the user’s setup:
su - ravi
whoami
id
su - ravi
: Switches toravi
’s environment.whoami
: Confirms the current user (ravi
).id
: Shows user ID, group ID, and group memberships.
This is great for verifying user accounts and troubleshooting login issues.
🔐 Granting Sudo Access
To give ravi
administrative privileges:
sudo usermod -aG sudo ravi
The -aG
flag adds ravi
to the sudo
group without removing existing memberships. Now ravi
can run sudo
commands securely.
👥 Managing Groups
For team collaboration, I created a devs
group and added ravi
to it:
sudo groupadd devs
sudo usermod -aG devs ravi
groups ravi
groupadd devs
: Creates a new group.usermod -aG devs ravi
: Addsravi
todevs
.groups ravi
: Listsravi
’s group memberships.
This setup is perfect for managing permissions for multiple users, like developers sharing project files.
📂 Changing Group Ownership
To assign files or folders to a group:
sudo chgrp devs filename
sudo chgrp -R devs /home/ritesh/shared_folder
The -R
flag applies group ownership recursively to directories and their contents.
📁 Setting Up a Shared Folder
To create a team-accessible folder with group inheritance:
sudo mkdir /home/ritesh/shared_folder
sudo chgrp devs /home/ritesh/shared_folder
sudo chmod 770 /home/ritesh/shared_folder
sudo chmod g+s /home/ritesh/shared_folder
770
: Grants read/write/execute access to the owner anddevs
group; others have no access.g+s
(setgid): Ensures new files in the folder inherit thedevs
group.
This setup is ideal for collaborative projects, ensuring consistent permissions.
✅ Key Takeaways
User Creation: Use
adduser
for user setup andpasswd
for passwords.Group Management:
groupadd
andusermod -aG
streamline team permissions.Sudo Access: Grant admin rights securely with
sudo
group.Permissions:
chgrp
andchmod
control access;g+s
ensures group inheritance.
💡 Tips for DevOps Beginners
Master Linux Basics: User and group management is foundational for server administration and DevOps roles.
Practice Hands-On: Set up a local Linux environment (e.g., Ubuntu VM) to run these commands and build confidence.
Explore Further: Try commands like
userdel
orgroupdel
to manage cleanup, or experiment with advanced permissions (e.g., ACLs).Document Your Journey: Keep a journal (like my GitHub repo) to track progress.
🚀 What’s Next?
DevOps Skills: Start learning Docker commands to prepare for containerization certifications like Docker Certified Associate.
Career Goals: Build toward certifications like Certified Kubernetes Administrator (CKA), leveraging my Linux skills.
Follow my journey on LinkedIn and GitHub. Drop a comment below—how are you learning Linux or DevOps? Let’s connect! 😊
#DevOps #Linux #UserManagement #GroupManagement
Subscribe to my newsletter
Read articles from Ritesh Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Ritesh Singh
Ritesh Singh
Hi, I’m Ritesh 👋 I’m on a mission to become a DevOps Engineer — and I’m learning in public every single day.With a full-time commitment of 8–10 hours daily, I’m building skills in: ✅ Linux✅ Git & GitHub✅ Docker & Kubernetes✅ AWS EC2, S3✅ Jenkins, GitHub Actions✅ Terraform, Prometheus, Grafana I post daily blogs on Hashnode, push projects to GitHub, and stay active on LinkedIn and Twitter/X. Let’s connect, collaborate, and grow together 🚀 #100DaysOfDevOps #LearningInPublic #DevOps