Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. The acctmgr script is used to:
  2.  
  3. * report on commonly requested user configurations.
  4. * perform common user account tasks.
  5.  
  6. The script suports four reporting options:
  7.  
  8. --reportnopassword : Shows a list of all user accounts without a password set. All found accounts are locked.
  9. --reportexpired : Show all expired accounts.
  10. --reportexpiration : Show expiration date/time for all accounts.
  11. --reportnoexpire : Show all accounts with no expiration date.
  12.  
  13. Additionally, the script supports four different acounts that can be taken on user accounts:
  14.  
  15. --unlock : Unlocks a user account. Pass the username with the --username parameter (see examples below).
  16. --lock : Lock a user account. Pass the username with the --username parameter (see examples below).
  17. --useradd : Creates a new user account. Will prompt for details if none are defined.
  18. --username : Defines the username for the new user account.
  19. --userhome : Defines the home for the new user account.
  20. --userfull : Defines the full name of the user account.
  21. --userpass : Defines the default password for the new user account.
  22. --userexpire : Defines the expiration date for the account in YYYY-MM-DD format.
  23. --useraddfile : Defines the path to a file that contains accounts to add in user:home:name:password:expiration format.
  24. --setexpiration : Set the expiration date on an account. Pass username with --username and date with --userexpir parameters.
  25.  
  26. The following common parameters can be issued as well;
  27.  
  28. --help : Displays a quick reference to the commands available.
  29. --log : Defines the path to log output of the script to.
  30.  
  31. Restrictions & Guidance:
  32.  
  33. * You may run as many reports in a single request as desired.
  34. * Only one user action may be taken request.
  35. * You may not run a user action and a report in the same request.
  36. * If you define a log file, any existing log file by the same name will be overwritten.
  37.  
  38. Examples:
  39.  
  40. The following examples assume that you have set U+X with chmod on the script and that
  41. you have permissions to run the script with sudo.
  42.  
  43. ## Runas all available reports in one command.
  44. ./acctmgr.sh --reportnopassword --reportexpired --reportexpiration --reportnoexpire
  45.  
  46. ## Runs the report of accounts that do not expire and logs into file.
  47. ./acctmgr.sh --reportnoexpire --log nonexpiring.log
  48.  
  49. ## Locks a given user account named 'linuxtest'
  50. ./acctmgr.sh --lock --username linuxtest
  51.  
  52. ## Unlocks a given user account named 'linuxtest'
  53. ./acctmgr.sh --unlock --username linuxtest
  54.  
  55. ## Sets the expiration date on account 'linuxtest' to 2020-12-31
  56. ./acctmgr.sh --setexpiration --username linuxtest --userexpire 2020-12-31
  57.  
  58. ## Create a new user named mylinuxguy with defined properties.
  59. ./acctmgr.sh --useradd --username mylinuxguy --userhome /home/mylinuxguy --userfull "My linux Guy!!" --userpass "N0n0FUrBiz" --userexpire 2020-12-31
  60.  
  61. ## Creates a list of new users using the (included) acctmgr.USERSAMPLE file
  62. ./acctmgr.sh --useradd --useraddfile acctmgr.USERSAMPLE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement