This project enhances Linux system security by optimising file permissions, ensuring least privilege access. Key updates include permission adjustments for sensitive files and directories, aligning with organisational policies.
The following screenshot demonstrates how to use Linux commands to verify current permissions for a specific directory.

The initial line in the screenshot displays the command entered, while the subsequent lines show the output. This code lists all items in the projects directory. We used the ls command with the -la option to display a detailed list of file contents. This option shows:
- All files, including hidden files (
.prefix) - Detailed file information, including permissions, ownership, and timestamps
The 10-character string represents file permissions, indicating who has access and what permissions are granted.
The string follows the ugo=rwx format, where:
urepresents user permissionsgrepresents group permissionsorepresents other permissionsrrepresents read permissionwrepresents write permissionxrepresents execute permission
- File Type (1st character)
d: Directory-(hyphen): Regular file
- User Permissions (2nd-4th characters)
r: Read permissionw: Write permissionx: Execute permission-(hyphen): Absence of permission
- Group Permissions (5th-7th characters)
r: Read permissionw: Write permissionx: Execute permission-(hyphen): Absence of permission
- Other Permissions (8th-10th characters)
r: Read permissionw: Write permissionx: Execute permission-(hyphen): Absence of permission
Note: "Others" includes all system users except the user and group.
Example
Consider the file project_t.txt with permissions -rw-rw-r--.
Following the organisation's decision to restrict write access for other users to all files, we reviewed the previously obtained file permissions. We identified that project_k.txt required removal of write access for other.
To achieve this, we used the chmod command. The following screenshot demonstrates the command execution:

The first two lines in the screenshot display the commands entered:
chmod o-w project_k.txt
ls -laThe subsequent lines present the output of the ls -la command, showcasing the updated permissions.
Leveraging the chmod command, we specified other as the target. The first argument o-w indicated the removal of write permissions, and the second argument project_k.txt specified the file.
Before: -rw-rw-r--
After: -rw-r--r--
To confirm the changes made, we utilised ls -la to review the updated permissions. The output verifies that write permissions were successfully removed for other users.
Changing Permissions on a Hidden File
Our organisation's research team archived project_x.txt and required restricted write access, allowing only the user and group to have read access. We utilised Linux commands to modify the permissions:

The screenshot displays:
- Commands entered:
chmod u-w,g-w,g+r .project_x.txt
ls -la- Output of
ls -lacommand
Recognising .project_x.txt as a hidden file (due to its period prefix), we:
- Revoked write permissions from
userandgroupusingu-wandg-w - Granted read permissions to the group with
g+r
To align with organisational policies, we restricted access to the drafts directory and its contents to researcher2 only. We ensured no other users possessed execute permissions:

The screenshot displays:
- Commands entered:
chmod g-x drafts
ls -la- Output of
ls -lacommand
Having identified the group's execute permissions, we utilised chmod to eliminate them. Since researcher2 already had execute permissions, no further adjustments were necessary.
In summary, our efforts ensured comprehensive alignment of file and directory permissions with organisational security requirements. Key takeaways:
- Initial
ls -laassessment provided crucial insights - Systematic permission adjustments using
chmod - Robust security posture for the projects directory
This project showcased our expertise in Linux commands and proactive cybersecurity measures through effective permission management.