Assignment 2 - User Management
Requirements: Create a script that can be run from the crontab or the command line to help administer accounts. The script should allow for the creation and modification of accounts, as well as reporting on account status. The script should be able to perform the following tasks:
1. Report all users that do not have a password. If an account does not have a password, the program will automatically lock the account and report that it has been locked.
2. Report all expired accounts.
3. Report the expiration date/time for all accounts.
4. Report all accounts that do not expire.
5. Unlock or lock user accounts specified on the command line.
6. Add a user account to the system (interactive only - not run from the crontab). This should include specifying the username, home directory, user's full name, password, and expiration date. The script should allow for the usernames to be specified on the command line or read from a file specified on the command line. The script should either prompt for the detailed information or read it from the file. When adding an account, the user should be required to reset their password upon first login into the system.
7. Change the expiration date for users specified on the command line. The root account should not be allowed to have an expiration date.
8. The script should be able to write the results to a log file specified on the command line.
The script(s) should be able to run on a Linux system. Please note that they will not be able to run on the university's servers. You will need to run the script as a privileged user. You can use any of the following scripting languages as the main programming language: bash, sh, ksh, perl, and python.
Deliverables:
1. Script/program: This should be a well-documented text file. If you need to use multiple scripts/programs, that is acceptable.
2. How-To file: This should be a text file that describes the operation of the program, including the program options and examples of how to run the script.
3. Test plan: This can be either a Word, Text, or PDF file. The plan should describe how you will test the program and how you will prove that the script worked for each of the requirements listed.