![]() |
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! |
a 'man passwd' gave me:
# passwd -aS Oups, hit enter a bit too quick... a = all, You should be able to work it out from there ;) |
Quote:
passwd: bad argument -aS: unknown option Sorry, tried it before (I even used passwd -a -S ). Which version of fedora are you using? Mine is Fedora 11 |
I am running Kubuntu with the password binary version 4.1.1
Code:
$ dpkg -l|grep passwd |
Solved :-)
Yep, I needed to run a little script to first get all the users and then pass them to passwd -s
Code:
USERS="$(cut -d: -f 1 /etc/passwd)" |
| All times are GMT -5. The time now is 04:30 AM. |