Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

-

-

-image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

What is franchising?

Answered: 1 week ago