Repo Browser

bashcards/bashcards-bashcards
cards/875822802628--password-guardian/assets/raw.sh
#!/bin/bash
c=$'\033[1;36m';r=$'\033[0m';l(){ echo "$(date +%F\ %T) - $1">>/var/log/password_management.log;}
while:;do clear;echo -e "${c} - Password Management${r}
1) Change Own Password  2) Change User Password  3) Force Password Change
4) Set Expiration      5) Lock Password        6) Unlock Password
7) Audit Settings      8) Batch Operations     9) Exit";read -p"Choice: "x;case $x in
1) passwd;read -n1 -s -r -p "Press any key...";;
2) read -p"User: "u;id $u&>/dev/null&&passwd $u&&l "Changed password for $u"||echo "User not found.";read -n1 -s -r -p "Press any key...";;
3) read -p"User: "u;id $u&>/dev/null&&chage -d0 $u&&l "Forced password change for $u"||echo "User not found.";read -n1 -s -r -p "Press any key...";;
4) read -p"User: "u;if id $u&>/dev/null;then read -p"Max: "m;read -p"Min: "n;read -p"Warn: "w;chage -M$m -m$n -W$w $u&&l "Set expiry for $u";else echo "User not found.";fi;read -n1 -s -r -p "Press any key...";;
5) read -p"User: "u;id $u&>/dev/null&&passwd -l $u&&l "Locked password for $u"||
NameTypeSize
auto-art.pngfile580,295
back-data-url.txtfile200,426
back-thumb.pngfile118,557
back.pngfile150,302
front-data-url.txtfile243,194
front-thumb.pngfile112,832
front.pngfile182,378
manifest.txtfile184
qr-payload.txtfile667
raw.shfile1,021