Question: IA 2 1 2 - Project ( 2 0 pts total ) Please, submit the following items to Canvas. Screenshots for executing questions ( #

IA 212- Project (20 pts total)
Please, submit the following items to Canvas.
Screenshots for executing questions (#1-6)(2 points)
Upload script code (question #7) as a text file with comments explain what the
commands are doing (2 points)
Screenshots for running script successfully with several cases (1 points)
a. Refer to the example towards the bottom of the instructions
Create three users with different passwords using root user. (3 points)
Add two users of them to the wheel group.
A. Please, explain the difference between the users on the wheel group and the
one which is not in the wheel group (1 point)
Add the remaining user to the group Typical_Users.
A. If the group does not exist, you should create it (1 point)
Create a folder and name it as Privilege folder. (1 point)
Give the users on the wheel group the full permissions rights (read, write and
execute) on Privilege folder. (1 point)
For the user part of Typical_Users assign read permissions on the Privilege folder. (I
point)
Write a shell script which is going to do the following:
A. Keep asking the user to enter the user name through the terminal until "root" user
name entered then the script will be terminated (3 points)
Hint: use while
B. The shell script will pass the value of user name to a function (written inside
the same script) which is going to do the following:
Add the user to the system (1 point)
Check if the user addition failed and print a message "Useradd
failed" Hint (use " $ ?"-ne "0" as condition)-ne means not equal
Then exit the function with value of 1 using (return 1)
Note (return will exit from the function while exit will quit the shill script)
Change the user password using passwd command (1 point)
Check if the password changed is failed and print a message
"Setting password failed"
Hint (use "$?"-ne "0" as condition)(1 point)
Then exit the function with value of 2 using (return 2)
Finally, check the value returned by the function using $ ?
If the value is 1 print "Something went wrong with useradd"
If the value is 2 print "Something went wrong with passwd"
Otherwise print "added to the system." (1 point)
Please, check the following output example of running the script:
IA 2 1 2 - Project ( 2 0 pts total ) Please,

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 Accounting Questions!