Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.10 KB | None | 0 0
  1. Script started on 2018-10-21 17:24:29-0400
  2. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-1
  3. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ useradd nopassword[1@s[1@u[1@d[1@o[1@
  4. [sudo] password for chris:
  5. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ passwd -d nopassword
  6. passwd: Permission denied.
  7. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ passwd -d nopassword[1@s[1@u[1@d[1@o[1@
  8. passwd: password expiry information changed.
  9. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ cat /etc/shadwow \ g| grep nopassword
  10. cat: /etc/shadow: Permission denied
  11. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ cat /etc/shadow | grep nopassword
  12. [1@s[1@u[1@d[1@o[1@
  13. nopassword::17825:0:99999:7:::
  14. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ./sudo ./acctmgr.sh --reportnopassword
  15. Account Management Script - Christopher Kibble
  16.  
  17. Reporting all user accounts that don't have a password
  18.  
  19. root is already locked.
  20. daemon does not have a password set and does not permitted login.
  21. bin does not have a password set and does not permitted login.
  22. sys does not have a password set and does not permitted login.
  23. sync does not have a password set and does not permitted login.
  24. games does not have a password set and does not permitted login.
  25. man does not have a password set and does not permitted login.
  26. lp does not have a password set and does not permitted login.
  27. mail does not have a password set and does not permitted login.
  28. news does not have a password set and does not permitted login.
  29. uucp does not have a password set and does not permitted login.
  30. proxy does not have a password set and does not permitted login.
  31. www-data does not have a password set and does not permitted login.
  32. backup does not have a password set and does not permitted login.
  33. list does not have a password set and does not permitted login.
  34. irc does not have a password set and does not permitted login.
  35. gnats does not have a password set and does not permitted login.
  36. nobody does not have a password set and does not permitted login.
  37. systemd-network does not have a password set and does not permitted login.
  38. systemd-resolve does not have a password set and does not permitted login.
  39. syslog does not have a password set and does not permitted login.
  40. messagebus does not have a password set and does not permitted login.
  41. _apt does not have a password set and does not permitted login.
  42. uuidd does not have a password set and does not permitted login.
  43. avahi-autoipd does not have a password set and does not permitted login.
  44. usbmux does not have a password set and does not permitted login.
  45. dnsmasq does not have a password set and does not permitted login.
  46. rtkit does not have a password set and does not permitted login.
  47. cups-pk-helper does not have a password set and does not permitted login.
  48. speech-dispatcher is already locked.
  49. whoopsie does not have a password set and does not permitted login.
  50. kernoops does not have a password set and does not permitted login.
  51. saned does not have a password set and does not permitted login.
  52. pulse does not have a password set and does not permitted login.
  53. avahi does not have a password set and does not permitted login.
  54. colord does not have a password set and does not permitted login.
  55. hplip does not have a password set and does not permitted login.
  56. geoclue does not have a password set and does not permitted login.
  57. gnome-initial-setup does not have a password set and does not permitted login.
  58. gdm does not have a password set and does not permitted login.
  59. linuxtest is already locked.
  60. nopassword does not have a password set. Locking account.
  61. Locking Account nopassword
  62. passwd: password expiry information changed.
  63. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --reportnopassword | grep nopass### REQ-2
  64. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo cat /etc/shadwowow | grep nopassword
  65. nopassword:!:17825:0:99999:7:::
  66. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel nopassword
  67. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-3
  68. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo useradd -expired
  69. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ chagesudo chage -E 20187-12-31 expired
  70. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --reportexpired
  71. Account Management Script - Christopher Kibble
  72.  
  73. Reporting all user accounts that are expired
  74.  
  75. linuxtest has expired
  76. expired has expired
  77. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel expired
  78. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ #R## REQ-4
  79. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ usudo useradd aroundAwhile
  80. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -E 20121-12-31 aroundAwhile
  81. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --reportexpiration
  82. Account Management Script - Christopher Kibble
  83.  
  84. Reporting expiration dates on all user accounts
  85.  
  86. root does not have an expiration date.
  87. daemon does not have an expiration date.
  88. bin does not have an expiration date.
  89. sys does not have an expiration date.
  90. sync does not have an expiration date.
  91. games does not have an expiration date.
  92. man does not have an expiration date.
  93. lp does not have an expiration date.
  94. mail does not have an expiration date.
  95. news does not have an expiration date.
  96. uucp does not have an expiration date.
  97. proxy does not have an expiration date.
  98. www-data does not have an expiration date.
  99. backup does not have an expiration date.
  100. list does not have an expiration date.
  101. irc does not have an expiration date.
  102. gnats does not have an expiration date.
  103. nobody does not have an expiration date.
  104. systemd-network does not have an expiration date.
  105. systemd-resolve does not have an expiration date.
  106. syslog does not have an expiration date.
  107. messagebus does not have an expiration date.
  108. _apt does not have an expiration date.
  109. uuidd does not have an expiration date.
  110. avahi-autoipd does not have an expiration date.
  111. usbmux does not have an expiration date.
  112. dnsmasq does not have an expiration date.
  113. rtkit does not have an expiration date.
  114. cups-pk-helper does not have an expiration date.
  115. speech-dispatcher does not have an expiration date.
  116. whoopsie does not have an expiration date.
  117. kernoops does not have an expiration date.
  118. saned does not have an expiration date.
  119. pulse does not have an expiration date.
  120. avahi does not have an expiration date.
  121. colord does not have an expiration date.
  122. hplip does not have an expiration date.
  123. geoclue does not have an expiration date.
  124. gnome-initial-setup does not have an expiration date.
  125. gdm does not have an expiration date.
  126. chris does not have an expiration date.
  127. linuxtest has an expiration date of Wed Oct 10 00:00:00 UTC 2018 (17814)
  128. aroundAwhile has an expiration date of Fri Dec 31 00:00:00 UTC 2021 (18992)
  129. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel aroundawhileAawhileAwhile
  130. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-5
  131. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo useradd willNeverdieDie
  132. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --reportnoexpire
  133. Account Management Script - Christopher Kibble
  134.  
  135. Reporting on user accounts without an expiration date
  136.  
  137. root does not have an expiration date.
  138. daemon does not have an expiration date.
  139. bin does not have an expiration date.
  140. sys does not have an expiration date.
  141. sync does not have an expiration date.
  142. games does not have an expiration date.
  143. man does not have an expiration date.
  144. lp does not have an expiration date.
  145. mail does not have an expiration date.
  146. news does not have an expiration date.
  147. uucp does not have an expiration date.
  148. proxy does not have an expiration date.
  149. www-data does not have an expiration date.
  150. backup does not have an expiration date.
  151. list does not have an expiration date.
  152. irc does not have an expiration date.
  153. gnats does not have an expiration date.
  154. nobody does not have an expiration date.
  155. systemd-network does not have an expiration date.
  156. systemd-resolve does not have an expiration date.
  157. syslog does not have an expiration date.
  158. messagebus does not have an expiration date.
  159. _apt does not have an expiration date.
  160. uuidd does not have an expiration date.
  161. avahi-autoipd does not have an expiration date.
  162. usbmux does not have an expiration date.
  163. dnsmasq does not have an expiration date.
  164. rtkit does not have an expiration date.
  165. cups-pk-helper does not have an expiration date.
  166. speech-dispatcher does not have an expiration date.
  167. whoopsie does not have an expiration date.
  168. kernoops does not have an expiration date.
  169. saned does not have an expiration date.
  170. pulse does not have an expiration date.
  171. avahi does not have an expiration date.
  172. colord does not have an expiration date.
  173. hplip does not have an expiration date.
  174. geoclue does not have an expiration date.
  175. gnome-initial-setup does not have an expiration date.
  176. gdm does not have an expiration date.
  177. chris does not have an expiration date.
  178. willNeverDie does not have an expiration date.
  179. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel willNeverDie
  180. Script started on 2018-10-21 17:34:09-0400
  181. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-6
  182. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo useradd lotteyr
  183. [sudo] password for chris:
  184. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ papasswd lottery
  185. passwd: You may not view or modify password information for lottery.
  186. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ passwd lottery[1@s[1@u[1@d[1@o[1@
  187. Enter new UNIX password:
  188. Retype new UNIX password:
  189. passwd: password updated successfully
  190. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo passwd lotterysudo useradd lottey### REQ-6exitsudo ./acctmgr.sh --username lottery --unlock
  191. passwd lottery NoneOfYourbusiness1
  192. ####### CLEANUPsudo ./acctmgr.sh --username lottery --unlock
  193. ### REQ-7sudo cat /etc/shadow | grep lottery./acctmgr.sh --username lottery --lock
  194. useradd lottery### REQ-6sudo useradd lottery./acctmgr.sh --username lottery --lock
  195. Account Management Script - Christopher Kibble
  196.  
  197. Locking Account lottery
  198. passwd: password expiry information changed.
  199. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo cat /et/c/shadow | grep lottery
  200. lottery:!$6$.Bh7Ek83$FUcw78YQW9pc1oiXBE4aEwFhsJBCOVoR2VXsIPstPAiOZa/ZzPPZHnQSPJByexKikAGRDTs3qouUN2qrK9SVB0:17825:0:99999:7:::
  201. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo cat /etc/shadow | grep lottery
  202. ./acctmgr.sh --username lottery --lock# REQ-7## REQ-7
  203. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-7sudo cat /etc/shadow | grep lottery
  204. ./acctmgr.sh --username lottery --lockunlock
  205. Account Management Script - Christopher Kibble
  206.  
  207. Unlocking Account lottery
  208. passwd: password expiry information changed.
  209. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --username lottery --unlock
  210. ### REQ-7sudo cat /etc/shadow | grep lottery
  211. lottery:$6$.Bh7Ek83$FUcw78YQW9pc1oiXBE4aEwFhsJBCOVoR2VXsIPstPAiOZa/ZzPPZHnQSPJByexKikAGRDTs3qouUN2qrK9SVB0:17825:0:99999:7:::
  212. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel lottery
  213. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ### REQ-8
  214. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --useradd --username scripttest1 --usreful
  215. l "
  216. 
  217.  
  218. userful
  219. l --"Test User' --"r" --userpass "testpassword' --userexpire "2012-221-12-01"
  220. > ^C
  221. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### CLEANUP ###
  222. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### CLEANUP ###sudo ./acctmgr.sh --useradd --username scripttest1 --userfull
  223. l "Test User" --userpass "testpassword' --userexpire "2021-12-01"[1@"
  224. Account Management Script - Christopher Kibble
  225.  
  226. Where would like like the userhome for scripttest1 to be? ^C
  227. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --useradd --username scripttest1 --userfull
  228. l "Test User" --userpass "testpassword" --userexpire "2021-12-01"[1@-[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" 
  229.  
  230. [1@h[1@om--userpass "testpassword" --userexpire "2021-12-01" e--userpass "testpassword" --userexpire "2021-12-01"
  231. "/--userpass "testpassword" --userexpire "2021-12-01"s--userpass "testpassword" --userexpire "2021-12-01"c--userpass "testpassword" --userexpire "2021-12-01"r--userpass "testpassword" --userexpire "2021-12-01"i--userpass "testpassword" --userexpire "2021-12-01"p--userpass "testpassword" --userexpire "2021-12-01"t--userpass "testpassword" --userexpire "2021-12-01"t--userpass "testpassword" --userexpire "2021-12-01"e--userpass "testpassword" --userexpire "2021-12-01"s--userpass "testpassword" --userexpire "2021-12-01"t--userpass "testpassword" --userexpire "2021-12-01"1--userpass "testpassword" --userexpire "2021-12-01" --userpass "testpassword" --userexpire "2021-12-01"
  232.  
  233.  
  234.  
  235. Account Management Script - Christopher Kibble
  236.  
  237. Creating User Account scripttest1
  238. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  239. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ catsudo cat /etc/hshshadow | grep testuserscripttest1
  240. scripttest1:$6$JRQCcsN3$teTxLlM7qwMAXNW5wXVkSeUpIhhZVW9gWwOFHTf8uTnd7habRZA9YGmZhFfsC8B.HEJfDS//iVUE/9snaRSzX0:0:0:99999:7::18962:
  241. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo cat /etc/shadow | grep scripttest1[1@p[1@p[1@a[1@s[1@s[1@w[1@d
  242. scripttest1:x:1004:1004:Test User:/home/scripttest1:/bin/sh
  243. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l scripttest1
  244. Last password change : password must be changed
  245. Password expires : password must be changed
  246. Password inactive : password must be changed
  247. Account expires : Dec 01, 2021
  248. Minimum number of days between password change : 0
  249. Maximum number of days between password change : 99999
  250. Number of days of warning before password expires : 7
  251. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel scripttest1
  252. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-9
  253. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --useradd scripttest2
  254. scripttest2 is an unknown parameter.
  255. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --useradd scripttest2-scripttest2-scripttest2uscripttest2scripttest2escripttest2rscripttest2nscripttest2ascripttest2mscripttest2escripttest2 scripttest2
  256. Account Management Script - Christopher Kibble
  257.  
  258. What is the Full Name for scripttest2? Chris Kibble
  259. Where would like like the userhome for scripttest2 to be? /home/ki  kibbletest
  260. What will be the temporary password for scripttest2?
  261. When would like like the account to expire for scripttest2? (YYYY-MM-DD Format) 201 30-12  06-30
  262. Creating User Account scripttest2
  263. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  264. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo /etc/cat /etc/passwd | grep scripttest2
  265. scripttest2:x:1004:1004:Chris Kibble:/home/kibbletest:/bin/sh
  266. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l scripttest2
  267. Last password change : password must be changed
  268. Password expires : password must be changed
  269. Password inactive : password must be changed
  270. Account expires : Jun 30, 2030
  271. Minimum number of days between password change : 0
  272. Maximum number of days between password change : 99999
  273. Number of days of warning before password expires : 7
  274. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel scripttest2
  275. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-10
  276. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudoo ./usreracctmgr.sh --useraddd --useraddfile acctmgr.sh sh S.
  277. acctmgr.HOWTO acctmgr.sh acctmgr.USERSAMPLE
  278. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh -useradd --useraddfile acctmgr.USererererERSAMPLE
  279.  
  280. Account Management Script - Christopher Kibble
  281.  
  282. Creating New User Accounts from acctmgr.USERSAMPLE
  283. Attempting to create user1 (Test User 1) with Home /home/testuser1 that expires 2018-12-31.
  284. Creating User Account user1
  285. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  286. Attempting to create user2 (Test User 2) with Home /home/testuser2 that expires 2018-12-31.
  287. Creating User Account user2
  288. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  289. Attempting to create user3 (Test User 3) with Home /home/testuser3 that expires 2018-12-31.
  290. Creating User Account user3
  291. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  292. Attempting to create user4 (Test User 4) with Home /home/testuser4 that expires 2018-12-31.
  293. Creating User Account user4
  294. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  295. Attempting to create user5 (Test User 5) with Home /home/testuser5 that expires 2018-12-31.
  296. Creating User Account user5
  297. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  298. Attempting to create user6 (Test User 6) with Home /home/testuser6 that expires 2018-12-31.
  299. Creating User Account user6
  300. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  301. Attempting to create user7 (Test User 7) with Home /home/testuser7 that expires 2018-12-31.
  302. Creating User Account user7
  303. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  304. Attempting to create user8 (Test User 8) with Home /home/testuser8 that expires 2018-12-31.
  305. Creating User Account user8
  306. Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
  307. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo cat /etc/passwd | grep user"Test User"
  308. user1:x:1004:1004:Test User 1:/home/testuser1:/bin/sh
  309. user2:x:1005:1005:Test User 2:/home/testuser2:/bin/sh
  310. user3:x:1006:1006:Test User 3:/home/testuser3:/bin/sh
  311. user4:x:1007:1007:Test User 4:/home/testuser4:/bin/sh
  312. user5:x:1008:1008:Test User 5:/home/testuser5:/bin/sh
  313. user6:x:1009:1009:Test User 6:/home/testuser6:/bin/sh
  314. user7:x:1010:1010:Test User 7:/home/testuser7:/bin/sh
  315. user8:x:1011:1011:Test User 8:/home/testuser8:/bin/sh
  316. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user1
  317. Last password change : password must be changed
  318. Password expires : password must be changed
  319. Password inactive : password must be changed
  320. Account expires : Dec 31, 2018
  321. Minimum number of days between password change : 0
  322. Maximum number of days between password change : 99999
  323. Number of days of warning before password expires : 7
  324. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user12
  325. Last password change : password must be changed
  326. Password expires : password must be changed
  327. Password inactive : password must be changed
  328. Account expires : Dec 31, 2018
  329. Minimum number of days between password change : 0
  330. Maximum number of days between password change : 99999
  331. Number of days of warning before password expires : 7
  332. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user23
  333. Last password change : password must be changed
  334. Password expires : password must be changed
  335. Password inactive : password must be changed
  336. Account expires : Dec 31, 2018
  337. Minimum number of days between password change : 0
  338. Maximum number of days between password change : 99999
  339. Number of days of warning before password expires : 7
  340. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user34
  341. Last password change : password must be changed
  342. Password expires : password must be changed
  343. Password inactive : password must be changed
  344. Account expires : Dec 31, 2018
  345. Minimum number of days between password change : 0
  346. Maximum number of days between password change : 99999
  347. Number of days of warning before password expires : 7
  348. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user45
  349. Last password change : password must be changed
  350. Password expires : password must be changed
  351. Password inactive : password must be changed
  352. Account expires : Dec 31, 2018
  353. Minimum number of days between password change : 0
  354. Maximum number of days between password change : 99999
  355. Number of days of warning before password expires : 7
  356. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user56
  357. Last password change : password must be changed
  358. Password expires : password must be changed
  359. Password inactive : password must be changed
  360. Account expires : Dec 31, 2018
  361. Minimum number of days between password change : 0
  362. Maximum number of days between password change : 99999
  363. Number of days of warning before password expires : 7
  364. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user67
  365. Last password change : password must be changed
  366. Password expires : password must be changed
  367. Password inactive : password must be changed
  368. Account expires : Dec 31, 2018
  369. Minimum number of days between password change : 0
  370. Maximum number of days between password change : 99999
  371. Number of days of warning before password expires : 7
  372. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l user7988
  373. Last password change : password must be changed
  374. Password expires : password must be changed
  375. Password inactive : password must be changed
  376. Account expires : Dec 31, 2018
  377. Minimum number of days between password change : 0
  378. Maximum number of days between password change : 99999
  379. Number of days of warning before password expires : 7
  380. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ssudeo o userdel user1user1
  381. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel user12
  382. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel user23
  383. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel user34
  384. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel user45
  385. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel user56
  386. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel user67
  387. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel user78
  388. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ### REQ-=11^[[2~1
  389. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo useradd whenToExpire
  390. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./acctmgr.sh --setexpiration --userexpire 2018040-065-01 --
  391. username whenToexpireexpireExpire
  392. Account Management Script - Christopher Kibble
  393.  
  394. Changing Expiration date on whenToExpire to 2040-05-01
  395. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo chage -l whenToExpire
  396. Last password change : Oct 21, 2018
  397. Password expires : never
  398. Password inactive : never
  399. Account expires : May 01, 2040
  400. Minimum number of days between password change : 0
  401. Maximum number of days between password change : 99999
  402. Number of days of warning before password expires : 7
  403. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel whenToExpire
  404. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo userdel whenToExpire333### REQ=-12-12-12
  405. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-12sudo userdel whenToExpire[1@chage -./acctmgr.sh --setexpiration --userexpire 2040-05-01 --u
  406. username whenToExpireroot
  407. Account Management Script - Christopher Kibble
  408.  
  409. You cannot change the expiration date of the root account.
  410. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### REQ-133
  411. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo useradd reportUseruser
  412. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo passwd -d reportuser
  413. passwd: password expiry information changed.
  414. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo cat /etc/shadwo ow | grep reportuser
  415. reportuser::17825:0:99999:7:::
  416. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo ./eactctmgr.sh --reportnopassword --log myreport.txt
  417. Account Management Script - Christopher Kibble
  418.  
  419. Reporting all user accounts that don't have a password
  420.  
  421. root is already locked.
  422. daemon does not have a password set and does not permitted login.
  423. bin does not have a password set and does not permitted login.
  424. sys does not have a password set and does not permitted login.
  425. sync does not have a password set and does not permitted login.
  426. games does not have a password set and does not permitted login.
  427. man does not have a password set and does not permitted login.
  428. lp does not have a password set and does not permitted login.
  429. mail does not have a password set and does not permitted login.
  430. news does not have a password set and does not permitted login.
  431. uucp does not have a password set and does not permitted login.
  432. proxy does not have a password set and does not permitted login.
  433. www-data does not have a password set and does not permitted login.
  434. backup does not have a password set and does not permitted login.
  435. list does not have a password set and does not permitted login.
  436. irc does not have a password set and does not permitted login.
  437. gnats does not have a password set and does not permitted login.
  438. nobody does not have a password set and does not permitted login.
  439. systemd-network does not have a password set and does not permitted login.
  440. systemd-resolve does not have a password set and does not permitted login.
  441. syslog does not have a password set and does not permitted login.
  442. messagebus does not have a password set and does not permitted login.
  443. _apt does not have a password set and does not permitted login.
  444. uuidd does not have a password set and does not permitted login.
  445. avahi-autoipd does not have a password set and does not permitted login.
  446. usbmux does not have a password set and does not permitted login.
  447. dnsmasq does not have a password set and does not permitted login.
  448. rtkit does not have a password set and does not permitted login.
  449. cups-pk-helper does not have a password set and does not permitted login.
  450. speech-dispatcher is already locked.
  451. whoopsie does not have a password set and does not permitted login.
  452. kernoops does not have a password set and does not permitted login.
  453. saned does not have a password set and does not permitted login.
  454. pulse does not have a password set and does not permitted login.
  455. avahi does not have a password set and does not permitted login.
  456. colord does not have a password set and does not permitted login.
  457. hplip does not have a password set and does not permitted login.
  458. geoclue does not have a password set and does not permitted login.
  459. gnome-initial-setup does not have a password set and does not permitted login.
  460. gdm does not have a password set and does not permitted login.
  461. linuxtest is already locked.
  462. lottey is already locked.
  463. reportuser does not have a password set. Locking account.
  464. Locking Account reportuser
  465. passwd: password expiry information changed.
  466. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ cat myreport.txt
  467. Account Management Script - Christopher Kibble
  468.  
  469. Reporting all user accounts that don't have a password
  470.  
  471. root is already locked.
  472. daemon does not have a password set and does not permitted login.
  473. bin does not have a password set and does not permitted login.
  474. sys does not have a password set and does not permitted login.
  475. sync does not have a password set and does not permitted login.
  476. games does not have a password set and does not permitted login.
  477. man does not have a password set and does not permitted login.
  478. lp does not have a password set and does not permitted login.
  479. mail does not have a password set and does not permitted login.
  480. news does not have a password set and does not permitted login.
  481. uucp does not have a password set and does not permitted login.
  482. proxy does not have a password set and does not permitted login.
  483. www-data does not have a password set and does not permitted login.
  484. backup does not have a password set and does not permitted login.
  485. list does not have a password set and does not permitted login.
  486. irc does not have a password set and does not permitted login.
  487. gnats does not have a password set and does not permitted login.
  488. nobody does not have a password set and does not permitted login.
  489. systemd-network does not have a password set and does not permitted login.
  490. systemd-resolve does not have a password set and does not permitted login.
  491. syslog does not have a password set and does not permitted login.
  492. messagebus does not have a password set and does not permitted login.
  493. _apt does not have a password set and does not permitted login.
  494. uuidd does not have a password set and does not permitted login.
  495. avahi-autoipd does not have a password set and does not permitted login.
  496. usbmux does not have a password set and does not permitted login.
  497. dnsmasq does not have a password set and does not permitted login.
  498. rtkit does not have a password set and does not permitted login.
  499. cups-pk-helper does not have a password set and does not permitted login.
  500. speech-dispatcher is already locked.
  501. whoopsie does not have a password set and does not permitted login.
  502. kernoops does not have a password set and does not permitted login.
  503. saned does not have a password set and does not permitted login.
  504. pulse does not have a password set and does not permitted login.
  505. avahi does not have a password set and does not permitted login.
  506. colord does not have a password set and does not permitted login.
  507. hplip does not have a password set and does not permitted login.
  508. geoclue does not have a password set and does not permitted login.
  509. gnome-initial-setup does not have a password set and does not permitted login.
  510. gdm does not have a password set and does not permitted login.
  511. linuxtest is already locked.
  512. lottey is already locked.
  513. reportuser does not have a password set. Locking account.
  514. Locking Account reportuser
  515. passwd: password expiry information changed.
  516. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ sudo user del reportuser
  517. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ ### COMPLETE ###
  518. ]0;chris@CK-UML2018: ~chris@CK-UML2018:~$ exit
  519. exit
  520.  
  521. Script done on 2018-10-21 17:47:08-0400
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement