Your task is to write a Bash script to create user accounts for all staff and visitors
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Your task is to write a Bash script to create user accounts for all staff and visitors

Your task is to write a Bash script to create user accounts for all staff and visitors. The supplied user file Usernames.txt is a text file containing a username and its type delimited by comma per line. There are two types of users: staff and visitor.

Staff users are added to the staff group and visitor users to the visitors group.

1. Write a Bash script, called createUsers.sh, to do the followings.

a) Create a group called visitors;

b) Create an account for each user and add the user to its group in one command.

All user accounts are created with an initial password the same as their username; a home directory with the same name as their username in the /home directory; all accounts use Bash shell program.

c) Write messages to syslog for all of the above events (new group, new user creation).

Note that while the current need is to handle limited number of usernames from the given user file, your script should be able to handle an arbitrary number of usernames.

2. Write a Bash script, called reportVisitors.sh, to report the members of visitors group to the file /tmp/visitors.txt.

3. Create a crontab entry to call the reportVisitors.sh script at 8:00AM and 9:00PM on every weekdays.

Hint
ComputerBash script reads and executes commands from a file which typically runs in a text window where the user types command that cause actions. Any command that can run from the command line can be used as a bash script which is a plain text file that contains a series of commands....

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.