Question: Lab 4 Linux Permissions Instructions: Create a Directory Structure: Create a directory called permissions _ lab. Inside permissions _ lab, create three subdirectories: documents, scripts,

Lab 4 Linux Permissions
Instructions:
Create a Directory Structure:
Create a directory called permissions_lab.
Inside permissions_lab, create three subdirectories: documents, scripts, and media.
Create Files:
Inside the documents directory, create two text files: file1.txt and file2.txt.
Initial Permissions:
Check and note the initial permissions of all files and directories using the ls -l command.
Change Permissions Using Symbolic Notation:
Change the permissions of file1.txt to allow the owner to read and write, the group to read, and others
to have no permissions.
chmod u=rw,g=r,o= file1.txt
Check the updated permissions.
Change Permissions Using Octal Notation:
Change the permissions of file2.txt to allow the owner to read, write, and execute, the group to read and
execute, and others to execute only.
chmod 711 file2.txt
Check the updated permissions.
Recursively Apply Permissions:
Apply the permission rw-r--r-- to all files in the scripts directory, and rwxr-xr-x to all files in the media
directory, including subdirectories.
chmod -R 644 scripts chmod -R 755 media
Check the updated permissions.
User and Group Ownership:
Change the ownership of file1.txt to a different user and group. Verify the ownership changes.
Understanding Numeric Permissions:
Experiment with numeric permissions on file2.txt. Change the permissions using octal notation in a way
that allows the owner to write, the group to read and execute, and others to have no permissions.
Confirm the changes.
Advanced Permission Setting:
For the permissions_lab directory, set permissions in a way that allows the owner to read, write, and
execute, the group to read and execute, and others to have no permissions. Confirm the changes.
Revoke Permissions:
Remove the execute permission for others on file2.txt and verify the changes.
Script Execution:
Create a simple script file named myscript.sh in the scripts directory. Allow the owner and group to
execute it, but others should have no permissions. Test the script execution.
Masking Permissions:
Create a directory named masked_dir. Set its permissions to rwxrwxrwx (777). Inside this directory,
create a file. Try setting restrictive permissions on the file, and observe if it is affected by the parent
directory's permissions.
Combining Symbolic and Octal Notations:
In the media directory, set permissions for file1.mp4 using both symbolic and octal notations. Verify the
changes.
Remove a File Securely:
Remove file2.txt in a way that ensures a confirmation prompt is provided, preventing accidental deletion.
Document the command used.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!