01 — Objective
A portfolio activity part of Google Cybersecurity Professional Certificate, where I examine and manage file permission. In this lab I explain the commands I use to manage file security
02 — Lab Record
Purpose
In this lab, I practiced using Linux commands to examine and manage file and directory permissions as part of my studies in the Google Cybersecurity Professional Certificate.
The goal was to understand how permissions control who can read, modify, or access files, and how incorrect permissions can be fixed using Linux commands.
Scenario
In this scenario, I needed to examine and manage the permissions of files inside the /home/researcher2/projects directory for the researcher2 user.
The researcher2 user is also part of the research_team group.
My task was to review the permissions of every file in the directory, including hidden files, and make sure they matched the required level of access.
I approached the task in three steps:
First, I checked the existing permissions of the files and directories.
Next, I identified files with incorrect permissions and changed them as needed.
Finally, I reviewed the /home/researcher2/projects/drafts directory and removed access that should not have been available to other users.
Check File and Directory Details
The lab started in the /home/researcher2 directory. From there, I examined the contents of the projects directory and checked the permissions assigned to each file.
I used:
This allowed me to view normal files, hidden files, their permissions, and their owners and groups.
From the output, I could see that the files belonged to the research_team group. I also noticed a hidden file named .project_x.txt that required attention.
Hidden files are easy to overlook because they do not normally appear with a basic ls command. Checking them is still important because their permissions can affect who is allowed to view or modify them.
In this case, .project_x.txt had permissions that needed to be changed.
Change File Permissions
One of the requirements was that users outside the owner and group should not have write access to files in the projects directory.
The file project_k.txt allowed other users to write to it, so I removed that permission with:
After making the change, I used ls -la again to verify that the permission had been updated correctly.
Another file, project_m.txt, was more restricted. Only the owner was supposed to have read and write access, while the group and other users should not have access.
I adjusted its permissions using the same chmod command with the appropriate permission settings, then verified the result again.
Change Permissions on a Hidden File
The hidden file .project_x.txt also had incorrect permissions.
The owner and group both had write access, but the requirement was that neither should be able to modify the file. The group should only be able to read it.
I first removed write access from the owner and group:
Then I gave the group read access:
Afterward, I checked the permissions again to make sure the file matched the required access.
Change Directory Permissions
The drafts directory had a different requirement.
Only the researcher2 user should be able to access it.
After checking the directory permissions with:
I noticed that the group also had execute permission. For a directory, execute permission allows a user to enter and access its contents.
Since the group should not have access, I removed that permission using:
I then verified the directory permissions again to confirm that only the intended user could access it.
Summary
This lab gave me hands-on practice with Linux file and directory permissions.
I used ls -la to inspect permissions and chmod to correct access that was too open. I also learned to pay attention to hidden files and directory permissions instead of checking only the visible files.
The biggest takeaway for me was that file permissions are not just about whether a file can be opened. They control exactly who can read, change, or access something, which makes them an important part of protecting a system.