Question: Question 3 is to implement system security and access control in Linux operating system Using Debian OS, write and implement ONE (1) bash shell script

Question 3 is to implement system security and access control in Linux operating system Using Debian OS, write and implement ONE (1) bash shell script for question 3. Question 3 (a), (b) and (c) should be in ONE (1) script. You are to use the root account to execute the script . The bash shell script should have the following specifications: Q3(a) 1. The script will prompt the user to enter a folder name in the current directory that the script is executed. That means that the folder is a sub-directory in the current directory. 2. It will check whether the folder exists, and if the folder does NOT exist, it will ask the user to re-enter the folder (it will keep prompting until the user enter a folder that exists in the current directory). 3. It will then prompt the user to enter a USERNAME of the Linux OS. 4. The folder name will then be changed to USERNAME-DDMMYYYY (e.g. if the USERNAME is userl, and today's date is 22 Feb 2022, then the folder name should be changed to user1-22022022). If the USERNAME-DDMMYYYY already exists, it should be deleted first 5. It will list all image files with the extension of .png and .gif in the folder and all its sub- folders (15 marks) Q3(b) 1. The script will then display the following message depending on the total size of all the .png and.gif image files. Less than or equal to 200 KB, display total image size is small More than 200 KB, display "total imge size is NOT small" 2. The owner and group of the folder, its sub folders and all files will then be updated to the USERNAME. 3. The permissions of the folder, its sub-folders and all files will then be updated such that only the owner can have all access, the group have read and write access, whereas others only have read access. 4. Necessary information needs to be displayed on screen after the script executed. The information should include the folder name before and after change, the total size of the folder (including all its sub-folders), and the total number of .png and .gif image files that are listed (15 marks) Q3(0) Validation check needs to be done in the bash shell script whenever possible (eg. when input a USERNAME, the script should check whether the USERNAME exists in the Linux OS) (10 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
