Bash processing tips needed for listing passwordless users.
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Bash processing tips needed for listing passwordless users.
Hi there guys:
I was asked to list passwordless or locked accounts in a fedora system. As far as I know, fedora or RH dont allow passwordless accounts (the system locks the account Edit: ... unless you set passwd -d :-P ), so I might show info about locked accounts.
I am totally aware that I could do a grep or an awk searching for "!!" or "", but my people is asking me to check against passwd -S (which prints info of accounts). The thing, is that in Solaris you can check with passwd -a -s all the users, but in Linux I couldnt find anything similar.
The question here is what approach do you reccomend for passing, say , the list of users ( like the output of awk searching only user names) to the command passwd -S one by one?
Any comments?
Thanks for your support!
Last edited by green_dood; 05-14-2009 at 12:17 PM.
I am running Kubuntu with the password binary version 4.1.1
Code:
$ dpkg -l|grep passwd
ii base-passwd 3.5.21 Debian base system master password and group
ii kdepasswd 4:4.2.2-0ubuntu4 password changer for KDE 4
ii passwd 1:4.1.1-6ubuntu6 change and administer password and group dat
what does the man page say? Maybe you have an older version but I'm sure you could loop through the passwd file and check them individually with the 'passwd -S' command
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.