Question
In this task, you need to implement system security and access control in Linux operating system. Using Debian OS, write and implement ONE (1) bash
In this task, you need to implement system security and access control in Linux operating system.
Using Debian OS, write and implement ONE (1) bash shell script. You are to use the root account to execute the script. The bash shell script should have the following specifications:
(a)
-
The script will prompt the user to enter a home directory (Note: all home directory is
stored in /home e.g. /home/user1).
-
It will check whether the home directory exist.
-
If the home directory does NOT exist, it will ask the user to re-enter the directory (it
will keep asking until the user enter an existing home directory).
It will list all text files (with the extension of .txt) in the home directory and all sub- directories.
-
It will then display the total size of all the text files in Bytes.
(b)
-
The script will then display the following message depending on the total size of all the
text files
o Less than 10,240 Bytes, display small o More than or equal to 10,240 Bytes, display big
Check that the /home directory and the owner of the home directory is the same. If they are the same, display Home directory and owner is the same. If they are NOT the same, display the home directory and the owner. o E.g. if home directory is /home/user, and the owner is user, display Home
directory and owner is the same o E.g. if home directory is /home/suss1, and the owner is suss5, display
/home/user1 user5
Change the following o owner of the home directory to root o permissions of the home directory (NOT the sub-directories) to the owner can
read and write, group can read, and others does NOT have any permissions
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