From Phobos D'thorga, 8 Months ago, written in Bash.
This paste will shuffle off the mortal coil in 2 Months.
Embed
  1. ┌───=Date: Sun Jan 06 Time: 02:11 PM (root@fireferret)
  2. |-[~]
  3. └──[λ]>- pwtemp --help
  4. /root/bin/pwtemp version [unknown] calling Getopt::Std::getopts (version 1.07 [paranoid]),
  5. running under Perl version 5.16.3.
  6.  
  7. Usage: pwtemp [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...]
  8.  
  9. The following single-character options are accepted:
  10.         Boolean (without arguments): -d -i -l -u
  11.  
  12. Options may be merged together.  -- stops processing of options.
  13.   [Now continuing due to backward compatibility and excessive paranoia.
  14.    See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION.]
  15. Usage: /root/bin/pwtemp <action> <username|email|ftpaccount|database>
  16.  
  17. Options:
  18.         -d      reset the password instead of toggle it
  19.         -l      will reset the user password and lock it using passwd.
  20.         -u      will unlock the user and reset it's password.
  21.        -i      replaces the hostname in any url's with the IP. This is done automatically on dedi/vps
  22. Actions:
  23.         System -
  24.                 setuser|unsetuser <user>
  25.                 setmail|unsetmail <email address>
  26.                 setftp|unsetftp <ftp@user>
  27.                 setplesk|unsetplesk <user>
  28.         WebApp -
  29.                 setwp|unsetwp <database>
  30.                 setjoomla|unsetjoomla <database>
  31.                 setdrupal|unsetdrupal <database>
  32.                 setmagento|unsetmagento <database>
  33.                 setzencart|unsetzencart <database>
  34.                 setvb|unsetvb <database>
  35.                 setwhmcs|unsetwhmcs <database>
  36.                 setphpbb|unsetphpbb <database>
  37.                 setsmf|unsetsmf <database>
  38.  
  39. Examples:
  40.         pwtemp setuser bob
  41.                 # cpanel user 'bob' is given a temporary password, which is displayed to you.
  42.                 # this user's password will be reverted to the original value after 15min.
  43.                 # (useful to gain temporary access to bob's account)
  44.  
  45.         pwtemp unsetuser bob
  46.                 # cpanel user 'bob', if he still has a temporary password, will immediately
  47.                 # have his original password restored, skipping the remainder of the 15min.
  48.                 # (useful to allow bob to access his own account without waiting)
  49.  
  50.         pwtemp setuser -d alice
  51.         pwtemp setuser -d alice@ali.ce
  52.                 # give cPanel user 'alice' and email account 'alice@ali.ce' new passwords,
  53.                 # permanently replacing the old passwords.
  54.                 # (useful if alice@ali.ce (owned by alice) is currently authing lots of spam)