how to findout if any passwords are missing in the /etc/passwd

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to findout if any passwords are missing in the /etc/passwd

Bidyut Saha
Sir,
 How to write a shellscript that will find out if any password are missing in the /etc/passwd file?
Reply | Threaded
Open this post in threaded view
|

Re: how to findout if any passwords are missing in the /etc/passwd

Guru
Administrator
Whichever field the password is, check for null in that field, you can use a command like this :

awk '$2==""' /etc/passwd

(assuming 2nd field is the password field)