Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Script started on 2018-10-21 17:24:29-0400
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-1
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ useradd nopassword[1@s[C[1@u[1@d[1@o[1@
- [sudo] password for chris:
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ passwd -d nopassword
- passwd: Permission denied.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ passwd -d nopassword[1@s[1@u[1@d[1@o[1@
- passwd: password expiry information changed.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ cat /etc/shadw[Kow \ g[K[K[K| grep nopassword
- cat: /etc/shadow: Permission denied
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ cat /etc/shadow | grep nopassword
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[1@s[1@u[1@d[1@o[1@
- [01;31m[Knopassword[m[K::17825:0:99999:7:::
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ./[K[Ksudo ./acctmgr.sh --reportnopassword
- Account Management Script - Christopher Kibble
- Reporting all user accounts that don't have a password
- root is already locked.
- daemon does not have a password set and does not permitted login.
- bin does not have a password set and does not permitted login.
- sys does not have a password set and does not permitted login.
- sync does not have a password set and does not permitted login.
- games does not have a password set and does not permitted login.
- man does not have a password set and does not permitted login.
- lp does not have a password set and does not permitted login.
- mail does not have a password set and does not permitted login.
- news does not have a password set and does not permitted login.
- uucp does not have a password set and does not permitted login.
- proxy does not have a password set and does not permitted login.
- www-data does not have a password set and does not permitted login.
- backup does not have a password set and does not permitted login.
- list does not have a password set and does not permitted login.
- irc does not have a password set and does not permitted login.
- gnats does not have a password set and does not permitted login.
- nobody does not have a password set and does not permitted login.
- systemd-network does not have a password set and does not permitted login.
- systemd-resolve does not have a password set and does not permitted login.
- syslog does not have a password set and does not permitted login.
- messagebus does not have a password set and does not permitted login.
- _apt does not have a password set and does not permitted login.
- uuidd does not have a password set and does not permitted login.
- avahi-autoipd does not have a password set and does not permitted login.
- usbmux does not have a password set and does not permitted login.
- dnsmasq does not have a password set and does not permitted login.
- rtkit does not have a password set and does not permitted login.
- cups-pk-helper does not have a password set and does not permitted login.
- speech-dispatcher is already locked.
- whoopsie does not have a password set and does not permitted login.
- kernoops does not have a password set and does not permitted login.
- saned does not have a password set and does not permitted login.
- pulse does not have a password set and does not permitted login.
- avahi does not have a password set and does not permitted login.
- colord does not have a password set and does not permitted login.
- hplip does not have a password set and does not permitted login.
- geoclue does not have a password set and does not permitted login.
- gnome-initial-setup does not have a password set and does not permitted login.
- gdm does not have a password set and does not permitted login.
- linuxtest is already locked.
- nopassword does not have a password set. Locking account.
- Locking Account nopassword
- passwd: password expiry information changed.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --reportnopassword | grep nopass[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K### REQ-2
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo cat /etc/shadwo[Kw[K[Kow | grep nopassword
- [01;31m[Knopassword[m[K:!:17825:0:99999:7:::
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel nopassword
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-3
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo useradd -[Kexpired
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ chage[K[K[K[K[Ksudo chage -E 2018[K7-12-31 expired
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --reportexpired
- Account Management Script - Christopher Kibble
- Reporting all user accounts that are expired
- linuxtest has expired
- expired has expired
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel expired
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ #R[K## REQ-4
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ u[Ksudo useradd aroundAwhile
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -E 201[K21-12-31 aroundAwhile
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --reportexpiration
- Account Management Script - Christopher Kibble
- Reporting expiration dates on all user accounts
- root does not have an expiration date.
- daemon does not have an expiration date.
- bin does not have an expiration date.
- sys does not have an expiration date.
- sync does not have an expiration date.
- games does not have an expiration date.
- man does not have an expiration date.
- lp does not have an expiration date.
- mail does not have an expiration date.
- news does not have an expiration date.
- uucp does not have an expiration date.
- proxy does not have an expiration date.
- www-data does not have an expiration date.
- backup does not have an expiration date.
- list does not have an expiration date.
- irc does not have an expiration date.
- gnats does not have an expiration date.
- nobody does not have an expiration date.
- systemd-network does not have an expiration date.
- systemd-resolve does not have an expiration date.
- syslog does not have an expiration date.
- messagebus does not have an expiration date.
- _apt does not have an expiration date.
- uuidd does not have an expiration date.
- avahi-autoipd does not have an expiration date.
- usbmux does not have an expiration date.
- dnsmasq does not have an expiration date.
- rtkit does not have an expiration date.
- cups-pk-helper does not have an expiration date.
- speech-dispatcher does not have an expiration date.
- whoopsie does not have an expiration date.
- kernoops does not have an expiration date.
- saned does not have an expiration date.
- pulse does not have an expiration date.
- avahi does not have an expiration date.
- colord does not have an expiration date.
- hplip does not have an expiration date.
- geoclue does not have an expiration date.
- gnome-initial-setup does not have an expiration date.
- gdm does not have an expiration date.
- chris does not have an expiration date.
- linuxtest has an expiration date of Wed Oct 10 00:00:00 UTC 2018 (17814)
- aroundAwhile has an expiration date of Fri Dec 31 00:00:00 UTC 2021 (18992)
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel aroundawhile[K[K[K[K[KA[K[Kawhile[K[K[K[K[K[KAwhile
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-5
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo useradd willNeverdie[K[K[KDie
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --reportnoexpire
- Account Management Script - Christopher Kibble
- Reporting on user accounts without an expiration date
- root does not have an expiration date.
- daemon does not have an expiration date.
- bin does not have an expiration date.
- sys does not have an expiration date.
- sync does not have an expiration date.
- games does not have an expiration date.
- man does not have an expiration date.
- lp does not have an expiration date.
- mail does not have an expiration date.
- news does not have an expiration date.
- uucp does not have an expiration date.
- proxy does not have an expiration date.
- www-data does not have an expiration date.
- backup does not have an expiration date.
- list does not have an expiration date.
- irc does not have an expiration date.
- gnats does not have an expiration date.
- nobody does not have an expiration date.
- systemd-network does not have an expiration date.
- systemd-resolve does not have an expiration date.
- syslog does not have an expiration date.
- messagebus does not have an expiration date.
- _apt does not have an expiration date.
- uuidd does not have an expiration date.
- avahi-autoipd does not have an expiration date.
- usbmux does not have an expiration date.
- dnsmasq does not have an expiration date.
- rtkit does not have an expiration date.
- cups-pk-helper does not have an expiration date.
- speech-dispatcher does not have an expiration date.
- whoopsie does not have an expiration date.
- kernoops does not have an expiration date.
- saned does not have an expiration date.
- pulse does not have an expiration date.
- avahi does not have an expiration date.
- colord does not have an expiration date.
- hplip does not have an expiration date.
- geoclue does not have an expiration date.
- gnome-initial-setup does not have an expiration date.
- gdm does not have an expiration date.
- chris does not have an expiration date.
- willNeverDie does not have an expiration date.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel willNeverDie
- Script started on 2018-10-21 17:34:09-0400
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-6
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo useradd lotteyr[K
- [sudo] password for chris:
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ pa[K[Kpasswd lottery
- passwd: You may not view or modify password information for lottery.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ passwd lottery[1@s[1@u[1@d[1@o[1@
- Enter new UNIX password:
- Retype new UNIX password:
- passwd: password updated successfully
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo passwd lottery[5P[C[C[C[C[C[C[C[C[C[C[C[C[C[Csudo useradd lottey[10P### REQ-6[5Pexitsudo ./acctmgr.sh --username lottery --unlock
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[26Ppasswd lottery NoneOfYourbusiness1
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[24P####### CLEANUPsudo ./acctmgr.sh --username lottery --unlock
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C### REQ-7[Ksudo cat /etc/shadow | grep lottery[K./acctmgr.sh --username lottery --lock
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[23Puseradd lottery[11P### REQ-6sudo useradd lottery./acctmgr.sh --username lottery --lock
- Account Management Script - Christopher Kibble
- Locking Account lottery
- passwd: password expiry information changed.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo cat /et/[Kc/shadow | grep lottery
- [01;31m[Klottery[m[K:!$6$.Bh7Ek83$FUcw78YQW9pc1oiXBE4aEwFhsJBCOVoR2VXsIPstPAiOZa/ZzPPZHnQSPJByexKikAGRDTs3qouUN2qrK9SVB0:17825:0:99999:7:::
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo cat /etc/shadow | grep lottery
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C./acctmgr.sh --username lottery --lock[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K# REQ-7[K[K[K[K[K[K## REQ-7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-7sudo cat /etc/shadow | grep lottery
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C./acctmgr.sh --username lottery --lock[K[K[K[Kunlock
- Account Management Script - Christopher Kibble
- Unlocking Account lottery
- passwd: password expiry information changed.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --username lottery --unlock
- [C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C### REQ-7[Ksudo cat /etc/shadow | grep lottery
- [01;31m[Klottery[m[K:$6$.Bh7Ek83$FUcw78YQW9pc1oiXBE4aEwFhsJBCOVoR2VXsIPstPAiOZa/ZzPPZHnQSPJByexKikAGRDTs3qouUN2qrK9SVB0:17825:0:99999:7:::
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel lottery
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo [K[K[K[K[K### REQ-8
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --useradd --username scripttest1 --usreful
- l "[K[K
- [K[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[K
- [K[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[K[K[K[K[K[Kuserful
- l --[K[K"Test User' --[K[K[K[K[K"[Kr" --userpass "testpassword' --userexpire "2012-[K[K2[K[K21-12-01"
- > ^C
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### CLEANUP ###
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### CLEANUP ###sudo ./acctmgr.sh --useradd --username scripttest1 --userfull
- l "Test User" --userpass "testpassword' --userexpire "2021-12-01"[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[1P[1@"
- Account Management Script - Christopher Kibble
- Where would like like the userhome for scripttest1 to be? ^C
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --useradd --username scripttest1 --userfull
- l "Test User" --userpass "testpassword" --userexpire "2021-12-01"[C[C[1@-[C[C[1@-[1@u[1@s[1@e[1@r[1@h[1@o[1@m[1@e[1@ [1@/[1@e[1@tc--userpass "testpassword" --userexpire "2021-12-01" [A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[1P
- [K[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[1P[1P[1@h[1@om--userpass "testpassword" --userexpire "2021-12-01" [A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ce--userpass "testpassword" --userexpire "2021-12-01"
- "[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C/--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cs--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cc--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cr--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ci--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cp--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ct--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ct--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ce--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cs--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Ct--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C1--userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C --userpass "testpassword" --userexpire "2021-12-01"[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C
- Account Management Script - Christopher Kibble
- Creating User Account scripttest1
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ cat[K[K[Ksudo cat /etc/hsh[K[K[Kshadow | grep testuser[K[K[K[K[K[K[K[Kscripttest1
- [01;31m[Kscripttest1[m[K:$6$JRQCcsN3$teTxLlM7qwMAXNW5wXVkSeUpIhhZVW9gWwOFHTf8uTnd7habRZA9YGmZhFfsC8B.HEJfDS//iVUE/9snaRSzX0:0:0:99999:7::18962:
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo cat /etc/shadow | grep scripttest1[1P[1P[1P[1P[1P[1@p[1P[1P[1@p[1@a[1@s[1@s[1@w[1@d
- [01;31m[Kscripttest1[m[K:x:1004:1004:Test User:/home/[01;31m[Kscripttest1[m[K:/bin/sh
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l scripttest1
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 01, 2021
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel scripttest1
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-9
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --useradd scripttest2
- scripttest2 is an unknown parameter.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --useradd scripttest2-scripttest2-scripttest2uscripttest2[Cscripttest2escripttest2rscripttest2nscripttest2ascripttest2mscripttest2escripttest2 scripttest2
- Account Management Script - Christopher Kibble
- What is the Full Name for scripttest2? Chris Kibble
- Where would like like the userhome for scripttest2 to be? /home/ki kibbletest
- What will be the temporary password for scripttest2?
- When would like like the account to expire for scripttest2? (YYYY-MM-DD Format) 201 30-12 06-30
- Creating User Account scripttest2
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo /etc/[K[K[K[K[Kcat /etc/passwd | grep scripttest2
- [01;31m[Kscripttest2[m[K:x:1004:1004:Chris Kibble:/home/kibbletest:/bin/sh
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l scripttest2
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Jun 30, 2030
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel scripttest2
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-10
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo[Ko ./usr[Ker[K[K[K[Kacctmgr.sh --useraddd[K --useraddfile acctmgr.sh [K[K[Ksh [K[K[KS[K[K.
- acctmgr.HOWTO acctmgr.sh acctmgr.USERSAMPLE
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh -useradd --useraddfile acctmgr.USer[K[Ker[K[Ker[K[Ker[K[KERSAMPLE
- Account Management Script - Christopher Kibble
- Creating New User Accounts from acctmgr.USERSAMPLE
- Attempting to create user1 (Test User 1) with Home /home/testuser1 that expires 2018-12-31.
- Creating User Account user1
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- Attempting to create user2 (Test User 2) with Home /home/testuser2 that expires 2018-12-31.
- Creating User Account user2
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- Attempting to create user3 (Test User 3) with Home /home/testuser3 that expires 2018-12-31.
- Creating User Account user3
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- Attempting to create user4 (Test User 4) with Home /home/testuser4 that expires 2018-12-31.
- Creating User Account user4
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- Attempting to create user5 (Test User 5) with Home /home/testuser5 that expires 2018-12-31.
- Creating User Account user5
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- Attempting to create user6 (Test User 6) with Home /home/testuser6 that expires 2018-12-31.
- Creating User Account user6
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- Attempting to create user7 (Test User 7) with Home /home/testuser7 that expires 2018-12-31.
- Creating User Account user7
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- Attempting to create user8 (Test User 8) with Home /home/testuser8 that expires 2018-12-31.
- Creating User Account user8
- Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo cat /etc/passwd | grep user[K[K[K[K"Test User"
- user1:x:1004:1004:[01;31m[KTest User[m[K 1:/home/testuser1:/bin/sh
- user2:x:1005:1005:[01;31m[KTest User[m[K 2:/home/testuser2:/bin/sh
- user3:x:1006:1006:[01;31m[KTest User[m[K 3:/home/testuser3:/bin/sh
- user4:x:1007:1007:[01;31m[KTest User[m[K 4:/home/testuser4:/bin/sh
- user5:x:1008:1008:[01;31m[KTest User[m[K 5:/home/testuser5:/bin/sh
- user6:x:1009:1009:[01;31m[KTest User[m[K 6:/home/testuser6:/bin/sh
- user7:x:1010:1010:[01;31m[KTest User[m[K 7:/home/testuser7:/bin/sh
- user8:x:1011:1011:[01;31m[KTest User[m[K 8:/home/testuser8:/bin/sh
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user1
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user1[K2
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user2[K3
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user3[K4
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user4[K5
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user5[K6
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user6[K7
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l user7[K98[K[K8
- Last password change : password must be changed
- Password expires : password must be changed
- Password inactive : password must be changed
- Account expires : Dec 31, 2018
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ s[Ksudeo [K[K[Ko userdel user1[K[K[K[K[Kuser1
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel user1[K2
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel user2[K3
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel user3[K4
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel user4[K5
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel user5[K6
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel user6[K7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel user7[K8
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo [K[K[K[K[K### REQ-=[K11^[[2~[K[K[K[K[K1
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo useradd whenToExpire
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./acctmgr.sh --setexpiration --userexpire 2018[K[K[K040-06[K5-01 --
- username whenToexpire[K[K[K[K[K[Kexpire[K[K[K[K[K[KExpire
- Account Management Script - Christopher Kibble
- Changing Expiration date on whenToExpire to 2040-05-01
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo chage -l whenToExpire
- Last password change : Oct 21, 2018
- Password expires : never
- Password inactive : never
- Account expires : May 01, 2040
- Minimum number of days between password change : 0
- Maximum number of days between password change : 99999
- Number of days of warning before password expires : 7
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel whenToExpire
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo userdel whenToExpire[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K333[K[K[K### REQ=-12[K[K[K-12[K[K[K[K-12
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-12sudo userdel whenToExpire[1@chage -[C[C[C[C[C[C[C[C[C[C[C[C[C[C./acctmgr.sh --setexpiration --userexpire 2040-05-01 --u
- username whenToExpire[C[K[K[K[K[K[K[K[K[K[K[K[Kroot
- Account Management Script - Christopher Kibble
- You cannot change the expiration date of the root account.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### REQ-13[K3
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo useradd reportUser[K[K[K[Kuser
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo passwd -d reportuser
- passwd: password expiry information changed.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo cat /etc/shadwo [K[K[Kow | grep reportuser
- [01;31m[Kreportuser[m[K::17825:0:99999:7:::
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo ./e[Kact[Kctmgr.sh --reportnopassword --log myreport.txt
- Account Management Script - Christopher Kibble
- Reporting all user accounts that don't have a password
- root is already locked.
- daemon does not have a password set and does not permitted login.
- bin does not have a password set and does not permitted login.
- sys does not have a password set and does not permitted login.
- sync does not have a password set and does not permitted login.
- games does not have a password set and does not permitted login.
- man does not have a password set and does not permitted login.
- lp does not have a password set and does not permitted login.
- mail does not have a password set and does not permitted login.
- news does not have a password set and does not permitted login.
- uucp does not have a password set and does not permitted login.
- proxy does not have a password set and does not permitted login.
- www-data does not have a password set and does not permitted login.
- backup does not have a password set and does not permitted login.
- list does not have a password set and does not permitted login.
- irc does not have a password set and does not permitted login.
- gnats does not have a password set and does not permitted login.
- nobody does not have a password set and does not permitted login.
- systemd-network does not have a password set and does not permitted login.
- systemd-resolve does not have a password set and does not permitted login.
- syslog does not have a password set and does not permitted login.
- messagebus does not have a password set and does not permitted login.
- _apt does not have a password set and does not permitted login.
- uuidd does not have a password set and does not permitted login.
- avahi-autoipd does not have a password set and does not permitted login.
- usbmux does not have a password set and does not permitted login.
- dnsmasq does not have a password set and does not permitted login.
- rtkit does not have a password set and does not permitted login.
- cups-pk-helper does not have a password set and does not permitted login.
- speech-dispatcher is already locked.
- whoopsie does not have a password set and does not permitted login.
- kernoops does not have a password set and does not permitted login.
- saned does not have a password set and does not permitted login.
- pulse does not have a password set and does not permitted login.
- avahi does not have a password set and does not permitted login.
- colord does not have a password set and does not permitted login.
- hplip does not have a password set and does not permitted login.
- geoclue does not have a password set and does not permitted login.
- gnome-initial-setup does not have a password set and does not permitted login.
- gdm does not have a password set and does not permitted login.
- linuxtest is already locked.
- lottey is already locked.
- reportuser does not have a password set. Locking account.
- Locking Account reportuser
- passwd: password expiry information changed.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ cat myreport.txt
- Account Management Script - Christopher Kibble
- Reporting all user accounts that don't have a password
- root is already locked.
- daemon does not have a password set and does not permitted login.
- bin does not have a password set and does not permitted login.
- sys does not have a password set and does not permitted login.
- sync does not have a password set and does not permitted login.
- games does not have a password set and does not permitted login.
- man does not have a password set and does not permitted login.
- lp does not have a password set and does not permitted login.
- mail does not have a password set and does not permitted login.
- news does not have a password set and does not permitted login.
- uucp does not have a password set and does not permitted login.
- proxy does not have a password set and does not permitted login.
- www-data does not have a password set and does not permitted login.
- backup does not have a password set and does not permitted login.
- list does not have a password set and does not permitted login.
- irc does not have a password set and does not permitted login.
- gnats does not have a password set and does not permitted login.
- nobody does not have a password set and does not permitted login.
- systemd-network does not have a password set and does not permitted login.
- systemd-resolve does not have a password set and does not permitted login.
- syslog does not have a password set and does not permitted login.
- messagebus does not have a password set and does not permitted login.
- _apt does not have a password set and does not permitted login.
- uuidd does not have a password set and does not permitted login.
- avahi-autoipd does not have a password set and does not permitted login.
- usbmux does not have a password set and does not permitted login.
- dnsmasq does not have a password set and does not permitted login.
- rtkit does not have a password set and does not permitted login.
- cups-pk-helper does not have a password set and does not permitted login.
- speech-dispatcher is already locked.
- whoopsie does not have a password set and does not permitted login.
- kernoops does not have a password set and does not permitted login.
- saned does not have a password set and does not permitted login.
- pulse does not have a password set and does not permitted login.
- avahi does not have a password set and does not permitted login.
- colord does not have a password set and does not permitted login.
- hplip does not have a password set and does not permitted login.
- geoclue does not have a password set and does not permitted login.
- gnome-initial-setup does not have a password set and does not permitted login.
- gdm does not have a password set and does not permitted login.
- linuxtest is already locked.
- lottey is already locked.
- reportuser does not have a password set. Locking account.
- Locking Account reportuser
- passwd: password expiry information changed.
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ sudo user [Kdel reportuser
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ ### COMPLETE ###
- ]0;chris@CK-UML2018: ~[01;32mchris@CK-UML2018[00m:[01;34m~[00m$ exit
- exit
- Script done on 2018-10-21 17:47:08-0400
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement