The Key to Control: Navigating Users, Groups, and Permissions

Table Of Content Introduction What Are Users, Groups, and Permissions? Getting to Know Users Permissions: Who’s Allowed to Do What? Groups: The Cool kid's Club Changing Permissions with chmod Changing Ownership with chown Tips for Fellow Beginners Conclusion Introduction: Welcome to Day 8 of my 30 day Linux challenge! Today, I’m treating a topic that's important to navigating linux effectively : users, groups, and permissions. If you’re new to Linux like me, these might feel like a mystery, but they’re the key to keeping your system organized and secure. Think of it as deciding who gets the keys to your Linux house and what rooms they can enter. In this article, I’ll break it down in simple terms, share my learning curve, my awkward mistake, and make it fun so you’ll want to keep reading! What Are Users, Groups, and Permissions? Linux is like a big shared apartment building. Users are the people living there (like you or your friend logging in). Groups are like clubs that users can join to share access to certain things. Permissions are the rules about who can open, edit, or delete files and folders. Together, they make sure everyone plays nice and nobody messes with someone else’s stuff. For example, I’m the main user on my Linux system (let’s call me “Bigtee”), but I can add other users, like “crew,” and put them in groups to share files. Permissions let me decide if “crew” can just look at my files or edit them too. Getting to Know Users Every time you log into Linux, you’re using a user account. There’s also a super powerful user called root, who can do anything (like the landlord of the building). To see who you are, open the terminal (Ctrl + Alt + T) and type: whoami Bigtee To see all users on your system, check the /etc/passwd file: cat /etc/passwd This lists everyone, including system users (like “nobody” or “daemon”) that Linux uses behind the scenes. Don’t worry about them for now I’m just focusing on my account and maybe a friend’s. You can add a new user with: sudo adduser crew This asks for a password and some details. Now “crew” can log in! I tried this and felt like I was hiring a new teammate for my Linux adventure. Groups: The Cool kid's Club Groups make sharing easier. Imagine you have a folder of project files you want to share with “crew” but not everyone. You put you and “crew” in a group called “team.” To see what groups you’re in, type: groups Bigtee team To create a group: sudo groupadd team To add someone to it: sudo usermod -aG team crew Now “crew” is in the “team” group! I messed up once by forgetting the -a flag and kicked myself out of my own group lesson learned! Permissions: Who’s Allowed to Do What? Permissions are where the fun happens. Every file and folder has rules about who can read (look at it), write (edit it), or execute (run it, like a script). To see permissions, use: ls -l -rw-r--r-- 1 Bigtee team 123 may 4 12:00 notes.txt drwxr-xr-x 2 Bigtee team 4096 may 4 12:00 project That string of letters (-rw-r--r-- or drwxr-xr-x) is the permission code. Here’s the breakdown: First character: - means it’s a file, d means it’s a folder. Next three: Permissions for the owner (e.g., rw- means Bigtee can read and write but not execute). Middle three: Permissions for the group (e.g., r-- means team can only read). Last three: Permissions for everyone else (e.g., r-- means others can read). So, for notes.txt, I (Bigtee) can read and edit it, the “team” group can only read it, and so can everyone else. For the “project” folder, I can do everything, but “team” and others can only look inside and run stuff. Changing Permissions with chmod If I want to let “team” edit notes.txt, I change its permissions with chmod (change mode): chmod g+w notes.txt Now the group has write access. Check it with ls -l: -rw-rw-r-- 1 Bigtee team 123 Oct 10 12:00 notes.txt You can also use numbers, like chmod 664 notes.txt, where: 6 = read (4) + write (2) for owner and group. 4 = read for others. I accidentally made a file executable once (chmod +x) and wondered why it wouldn’t run, turns out it wasn’t a script. Changing Ownership with chown If I want “crew” to own notes.txt instead of me, I use chown (change owner): sudo chown crew notes.txt To give it to the “team” group: sudo chown :team notes.txt I tried this and got confused when permissions didn’t work as expected, i figured I forgot to check the group settings. Always double check! When I started this topic, I thought permissions would be boring, but it’s like playing gatekeeper for my files! I set up a “crew” user and a “team” group, shared a folder, and felt like a Linux boss. My big oops was changing permissions on a folder and locking myself out thankfully, sudo saved me. The terminal commands (chmod, chown) are starting to

May 4, 2025 - 11:03
 0
The Key to Control: Navigating Users, Groups, and Permissions

Table Of Content

  • Introduction

  • What Are Users, Groups, and Permissions?

  • Getting to Know Users

  • Permissions: Who’s Allowed to Do What?

  • Groups: The Cool kid's Club

  • Changing Permissions with chmod

  • Changing Ownership with chown

  • Tips for Fellow Beginners

  • Conclusion

Introduction:

Welcome to Day 8 of my 30 day Linux challenge! Today, I’m treating a topic that's important to navigating linux effectively : users, groups, and permissions. If you’re new to Linux like me, these might feel like a mystery, but they’re the key to keeping your system organized and secure. Think of it as deciding who gets the keys to your Linux house and what rooms they can enter. In this article, I’ll break it down in simple terms, share my learning curve, my awkward mistake, and make it fun so you’ll want to keep reading!

What Are Users, Groups, and Permissions?

Linux is like a big shared apartment building. Users are the people living there (like you or your friend logging in). Groups are like clubs that users can join to share access to certain things. Permissions are the rules about who can open, edit, or delete files and folders. Together, they make sure everyone plays nice and nobody messes with someone else’s stuff.

For example, I’m the main user on my Linux system (let’s call me “Bigtee”), but I can add other users, like “crew,” and put them in groups to share files. Permissions let me decide if “crew” can just look at my files or edit them too.

Getting to Know Users

Every time you log into Linux, you’re using a user account. There’s also a super powerful user called root, who can do anything (like the landlord of the building). To see who you are, open the terminal (Ctrl + Alt + T) and type:

whoami
Bigtee
  • To see all users on your system, check the /etc/passwd file:
cat /etc/passwd

This lists everyone, including system users (like “nobody” or “daemon”) that Linux uses behind the scenes. Don’t worry about them for now I’m just focusing on my account and maybe a friend’s.

  • You can add a new user with:
sudo adduser crew

This asks for a password and some details. Now “crew” can log in! I tried this and felt like I was hiring a new teammate for my Linux adventure.

Groups: The Cool kid's Club

Groups make sharing easier. Imagine you have a folder of project files you want to share with “crew” but not everyone. You put you and “crew” in a group called “team.” To see what groups you’re in, type:

groups
Bigtee team

To create a group:

sudo groupadd team

To add someone to it:

sudo usermod -aG team crew

Now “crew” is in the “team” group! I messed up once by forgetting the -a flag and kicked myself out of my own group lesson learned!

Permissions: Who’s Allowed to Do What?

Permissions are where the fun happens. Every file and folder has rules about who can read (look at it), write (edit it), or execute (run it, like a script). To see permissions, use:

ls -l
-rw-r--r-- 1 Bigtee team 123 may 4 12:00 notes.txt
drwxr-xr-x 2 Bigtee team 4096 may 4 12:00 project

That string of letters (-rw-r--r-- or drwxr-xr-x) is the permission code. Here’s the breakdown:

  • First character: - means it’s a file, d means it’s a folder.

  • Next three: Permissions for the owner (e.g., rw- means Bigtee can read and write but not execute).

  • Middle three: Permissions for the group (e.g., r-- means team can only read).

  • Last three: Permissions for everyone else (e.g., r-- means others can read).

So, for notes.txt, I (Bigtee) can read and edit it, the “team” group can only read it, and so can everyone else. For the “project” folder, I can do everything, but “team” and others can only look inside and run stuff.

Changing Permissions with chmod

If I want to let “team” edit notes.txt, I change its permissions with chmod (change mode):

chmod g+w notes.txt

Now the group has write access. Check it with ls -l:

-rw-rw-r-- 1 Bigtee team 123 Oct 10 12:00 notes.txt

You can also use numbers, like chmod 664 notes.txt, where:

  • 6 = read (4) + write (2) for owner and group.

  • 4 = read for others.

I accidentally made a file executable once (chmod +x) and wondered why it wouldn’t run, turns out it wasn’t a script.

Changing Ownership with chown

If I want “crew” to own notes.txt instead of me, I use chown (change owner):

sudo chown crew notes.txt

To give it to the “team” group:

sudo chown :team notes.txt

I tried this and got confused when permissions didn’t work as expected, i figured I forgot to check the group settings. Always double check!
When I started this topic, I thought permissions would be boring, but it’s like playing gatekeeper for my files! I set up a “crew” user and a “team” group, shared a folder, and felt like a Linux boss. My big oops was changing permissions on a folder and locking myself out thankfully, sudo saved me. The terminal commands (chmod, chown) are starting to feel like second nature, and I’m getting better at spotting mistakes.

Tips for Fellow Beginners

  • Start Small:Create a test user and group to practice without risking your main files.

  • Check Before You Change:Use ls -l to see permissions before messing with chmod or chown.

  • Use sudo Wisely: It’s powerful but can cause chaos if you’re not careful.

  • Write It Down:I keep a notebook with commands like chmod g+w so I don’t forget.

  • Have Fun:Pretend you’re running a secret club it makes permissions way more exciting!

Conclusion

Users, groups, and permissions are like the rules of a Linux party who’s invited, who’s in the VIP group, and what they’re allowed to do. As a beginner, I’m fascinated to understand how to keep my system secure and share files like a pro. This Day 8 challenge has me pumped to explore more Linux tricks. If I can figure this out, so can you! Open that terminal, play with some permissions, and let’s keep rocking this Linux journey together.

I’d love to hear your thoughts, experiences, or tips about Linux!
Feel free to share in the comments and join the conversation.
Connect with me on LinkedIn !

#30DaysLinuxChallenge #CloudWhistler #RedHat #Cloudsecurity #DevOps #Linux #OpenSource #CloudComputing #RedHatEnterpriseLinux #SystemLogs #EnterpriseIT #Observability #Logging #SysAdmin #Automation #CloudEngineer #TechForBusiness #ITSupport #SRE #CloudOps