File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Script Name : users_no_password.sh
4
+ # Author : Craig Richards
5
+ # Created : 05-September-2012
6
+ # Last Modified : 11-April-2013
7
+ # Version : 1.1
8
+
9
+ # Modifications : 1.1 - 11-April-2013 - CR - Changed to do an OS check so the same script can be used on either Solaris or Linux
10
+
11
+ # Description : This will show all OS accounts that don't have a password set.
12
+
13
+ if [[ ` uname -s` == ' Linux' ]]; then
14
+ nopass=` passwd -Sa | grep NP | awk ' {print $1}' `
15
+ elif [[ ` uname -s` == ' SunOS' ]]; then
16
+ nopass=` passwd -sa | grep NP | awk ' {print $1}' `
17
+ fi
18
+
19
+ if [ -z " $nopass " ]
20
+ then
21
+ echo " Good - All user accounts have a password"
22
+ else
23
+ echo " Not Good - $nopass has no password set"
24
+ fi
25
+
You can’t perform that action at this time.
0 commit comments