Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 4 Linux Permissions Instructions: Create a Directory Structure: Create a directory called permissions _ lab. Inside permissions _ lab, create three subdirectories: documents, scripts,
Lab Linux Permissions
Instructions:
Create a Directory Structure:
Create a directory called permissionslab.
Inside permissionslab, create three subdirectories: documents, scripts, and media.
Create Files:
Inside the documents directory, create two text files: filetxt and filetxt
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 filetxt to allow the owner to read and write, the group to read, and others
to have no permissions.
chmod urwgro filetxt
Check the updated permissions.
Change Permissions Using Octal Notation:
Change the permissions of filetxt to allow the owner to read, write, and execute, the group to read and
execute, and others to execute only.
chmod filetxt
Check the updated permissions.
Recursively Apply Permissions:
Apply the permission rwrr to all files in the scripts directory, and rwxrxrx to all files in the media
directory, including subdirectories.
chmod R scripts chmod R media
Check the updated permissions.
User and Group Ownership:
Change the ownership of filetxt to a different user and group. Verify the ownership changes.
Understanding Numeric Permissions:
Experiment with numeric permissions on filetxt 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 permissionslab 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 filetxt 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 maskeddir. Set its permissions to rwxrwxrwx 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 filemp using both symbolic and octal notations. Verify the
changes.
Remove a File Securely:
Remove filetxt 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started