Linux File Permissions Lab - Google Cybersecurity Certificate

Linux File Permissions Lab - Google Cybersecurity Certificate

Project description

This project aims to explore a user’s home directory on a linux system and practice user permissions.

Check file and directory details

First, we check our current directory with pwd after our user shell spawns. Then, we list the directories within our working directory (ls -lia) & change directory (cd)into projects

Describe the permissions string

Let’s use .project_x.txt as an example of permissions. The “.” character at the beginning of the file hides it from view when using just “ls”, so we add the flags -lia to see the file, it’s permissions, and the inode (we really just need -la to see the file and permissions).

Now that we see the file, we can look at the permissions string at the front. The first 3 denote the user permissions, the next 3 denote group permissions, and the last 3 are “other”. So our 

Change file permissions

Taking a look at the rest of our files, we see that “project_k.txt” has read/write permissions set for other. We need to change this so that other has no access to the file, based on our organization’s security requirements. We can use octal values with the chmod command to complete this. (for info on permissions: https://docs.oracle.com/cd/E19504-01/802-5750/6i9g464pv/index.html)

Change file permissions on a hidden file

Next, we need to fix the permissions on the .project_x.txt file. We can don’t want anyone editing this file (having the write permission), so we can set it to be read only for user and group:

Change directory permissions

We don’t want anyone else having access to our drafts folder, because this contains our drafts! It would be embarrassing for other researchers to see this. So, we change the directory’s permissions using chmod:

Summary

That’s it! We successfully changed permissions on several files and a directory on our linux system.