Advertisement
stanpython

120 Lab 3 Users Script

Oct 20th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. For this project, you will write a shell script to automate the creation and deletion of user accounts. The shell script you write should meet the following specifications:
  2.  
  3.  
  4.  
  5. 1)It should be named “buser”
  6.  
  7. 2)It should live in the /root/bin directory.
  8.  
  9. 3)It should be executable by the root user.
  10.  
  11. 4)It should accept the command line parameters in the following syntax:
  12.  
  13.  
  14. SYNOPSIS
  15. buser [-a] [-d] [-l] [--add] [--delete] [--list] [filename...]
  16.  
  17. DESCRIPTION
  18. This documents the IT 240 version of buser. This program adds, creates or lists multiple user accounts from a provide list in the form of a file specified at the command line.
  19.  
  20. OPTIONS
  21. -a, --add
  22.  
  23. Make a user account for each username contained in the named file.
  24.  
  25. -d, --delete
  26.  
  27. Delete user accounts listed in the named file.
  28.  
  29. -l, --list
  30.  
  31. Display the user account line from /etc/passwd for each user account name in the named file.
  32.  
  33.  
  34.  
  35. 1)When run, the script should look at the command line parameters and act appropriately.
  36.  
  37. 2)It should use the file named at the command line as the source of accounts to act upon. The named file in the command line will be a list of user account names of unknown number. Each account name will be separated by a carriage return.
  38.  
  39. 3) When creating/adding accounts, the script should also create home directories.
  40.  
  41. 4) When deleting accounts, the script should also delete user home directories.
  42.  
  43. 5)When listing accounts, the script should cause the line in /etc/password that corresponds to each account in the named file to be displayed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement