• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1145
  • Last Modified:

AIX /etc/security/passwd check accounts don't have a password set

I want to check that there are accounts with passwords in /etc/security/passwd. Some users such as root do, however, and I need to grep them out.  I'm struggling to this since grep -A and grep -B don't work on AIX and I'm not quite sure how to do this.

user1:
        password = blahblahblahx
        lastupdate = 1248784575

user2:
        password = *

daemon:
        password = *

bin:
        password = *

sys:
        password = *
0
lolaferrari
Asked:
lolaferrari
1 Solution
 
woolmilkporcCommented:
AIX's grep has "-p" (="paragraph"):

grep -p "password = \*" /etc/security/passwd

Or use awk or egrep to search for "*" (= "invalid password") in the second field of the /etc/passwd entries:

awk -F: ' $2=="*" ' /etc/passwd

egrep '^[A-z0-9]*:\*' /etc/passwd
0
 
lolaferrariAuthor Commented:
fantastic! many thanks!!!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now