Question: Write a linux bash scripting shell code for the q below: - - - Note that some of the tools below might be different from

Write a linux bash scripting shell code for the q below:

-

-

-Write a linux bash scripting shell code for the q below: -

Note that some of the tools below might be different from one Linux distribution to another. But we will assume Ubuntu 22.04 is being used. Shell script 1: (Main.sh) Main Script (Main. sh) will check your credentials. If correct, you will call the following subroutines: Display.sh, Network.sh, System.sh, Check.sh, Install.sh, and Search.sh. For more details, consider the following: - STEP1: If the logged-in user is part of the sudoers group, then, the main script will execute scripts, otherwise, it will ask the user to have the super user privileges (not the root user) to execute these scripts. - STEP2: For every invalid attempt, the system will record the name of the user and the time in a log file (invalid_attempts.log). The maximum number of attempts is 3. - STEP3: If the user exceeds the number of maximum attempts, then, your program will call a script to display the message "Unauthorized user!" and the system will reboot after one minute. - STEP4: All unsuccessful attempts will also be recorded in another log file (unsuccessful_attempts.log) that is erased every month on the 25th according to the current month's calendar. Now, to verify that STEP2 is working properly, you must do the following: - Create a new user (newuser) and add a password. Try to run the Main.sh under the newuser. - Create a new group (osgeeks) - Add this group (osgeeks) to the sudoers (/etc/sudoers) - Add the newuser to this osgeeks group - Try again running the Main.sh under the same user (newuser). Note that some of the tools below might be different from one Linux distribution to another. But we will assume Ubuntu 22.04 is being used. Shell script 1: (Main.sh) Main Script (Main. sh) will check your credentials. If correct, you will call the following subroutines: Display.sh, Network.sh, System.sh, Check.sh, Install.sh, and Search.sh. For more details, consider the following: - STEP1: If the logged-in user is part of the sudoers group, then, the main script will execute scripts, otherwise, it will ask the user to have the super user privileges (not the root user) to execute these scripts. - STEP2: For every invalid attempt, the system will record the name of the user and the time in a log file (invalid_attempts.log). The maximum number of attempts is 3. - STEP3: If the user exceeds the number of maximum attempts, then, your program will call a script to display the message "Unauthorized user!" and the system will reboot after one minute. - STEP4: All unsuccessful attempts will also be recorded in another log file (unsuccessful_attempts.log) that is erased every month on the 25th according to the current month's calendar. Now, to verify that STEP2 is working properly, you must do the following: - Create a new user (newuser) and add a password. Try to run the Main.sh under the newuser. - Create a new group (osgeeks) - Add this group (osgeeks) to the sudoers (/etc/sudoers) - Add the newuser to this osgeeks group - Try again running the Main.sh under the same user (newuser)

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!