206k views
0 votes
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 userl" 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 25im 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).

User MoonMist
by
8.1k points

1 Answer

4 votes

Final answer:

To test STEP2 of the Main.sh script, create a new user, attempt to execute the script, create a new group and add it to sudoers, then add the user to this group and retry executing the script.

Step-by-step explanation:

To verify that STEP2 of the Main.sh script is working correctly, follow the steps below:

  1. Create a new user called newuser and set a password for this user.
  2. Attempt to run the Main.sh script with the newuser account. This should fail due to insufficient permissions.
  3. Create a new group named osgeeks.
  4. Add the osgeeks group to the sudoers file, which is typically located at /etc/sudoers.
  5. Add newuser to the osgeeks group.
  6. Try running the Main.sh script again under the newuser account. With the correct permissions, it should now execute successfully.

Keep in mind that the Main.sh script is designed to monitor and log invalid access attempts. It's important to monitor both the invalid_attempts.log and unsuccessful_attempts.log to ensure they reflect the actual attempts and to verify proper logging functionality.

User Takiyah
by
8.5k points