File Permissions in Linux Exemplar
File Permissions in Linux Exemplar
Project description
The research team at my organization needs to update the file permissions for certain files
and directories within the projects directory. The permissions do not currently reflect the
level of authorization that should be given. Checking and updating these permissions will help
keep their system secure. To complete this task, I performed the following tasks:
The first line of the screenshot displays the command I entered, and the other lines display the
output. The code lists all contents of the projects directory. I used the ls command with the
-la option to display a detailed listing of the file contents that also returned hidden files. The
output of my command indicates that there is one directory named drafts, one hidden file
named .project_x.txt, and five other project files. The 10-character string in the first
column represents the permissions set on each file or directory.
For example, the file permissions for project_t.txt are -rw-rw-r--. Since the first
character is a hyphen (-), this indicates that project_t.txt is a file, not a directory. The
second, fifth, and eighth characters are all r, which indicates that user, group, and other all
have read permissions. The third and sixth characters are w, which indicates that only the user
and group have write permissions. No one has execute permissions for project_t.txt.
The first two lines of the screenshot display the commands I entered, and the other lines
display the output of the second command. The chmod command changes the permissions on
files and directories. The first argument indicates what permissions should be changed, and
the second argument specifies the file or directory. In this example, I removed write
permissions from other for the project_k.txt file. After this, I used ls -la to review the
updates I made.
The following code demonstrates how I used Linux commands to change the permissions:
The first two lines of the screenshot display the commands I entered, and the other lines
display the output of the second command. I know .project_x.txt is a hidden file because
it starts with a period (.). In this example, I removed write permissions from the user and
group, and added read permissions to the group. I removed write permissions from the user
with u-w. Then, I removed write permissions from the group with g-w, and added read
permissions to the group with g+r.
The following code demonstrates how I used Linux commands to change the permissions:
The first two lines of the screenshot display the commands I entered, and the other lines
display the output of the second command. I previously determined that the group had
execute permissions, so I used the chmod command to remove them. The researcher2 user
already had execute permissions, so they did not need to be added.
Summary
I changed multiple permissions to match the level of authorization my organization wanted for
files and directories in the projects directory. The first step in this was using ls -la to
check the permissions for the directory. This informed my decisions in the following steps. I
then used the chmod command multiple times to change the permissions on files and
directories.