cancel
Showing results for 
Search instead for 
Did you mean: 

NO Password

gogleboy
Occasional Advisor

NO Password

Hi Team,

Could you tell me the command to find no password users in server,

Thanks
Nanda
10 REPLIES
Steven E. Protter
Exalted Contributor

Re: NO Password

Shalom,

There is no command for that.

You can edit /etc/passwd and null out the password field.

Of course this will cause you problems on your next security audit.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor
Patrick Wallek
Honored Contributor

Re: NO Password

Run 'passwd -s ' for each user. If the result is something like:

username NP

Then that means the user does not have a password set.

This could be easily scripted as well:

for USER in $(awk -F : '{print $1}' /etc/passwd)
do
passwd -s ${USER}
done
mobidyc
Trusted Contributor

Re: NO Password

Hello,

on untrusted system you can use this command:
awk -F: '{if($2 ~ /\*/ ){print $1 " has curently no password"}}' /etc/passwd

on trusted system, use the /etc/shadow file.

regars,
Cedrick Gaillard
Best regards, Cedrick Gaillard
OldSchool
Honored Contributor

Re: NO Password

I don't recall exactly, but, if you're root, "passwd -s" (without id) or "passwd -s *" should list every user currently in /etc/passwd. I believe it's the first case, but haven't got access to an hp box at the moment
mobidyc
Trusted Contributor

Re: NO Password

I'm not sure OldSchool:

# passwd -s
root PS
# passwd -s *
Invalid login name.
# passwd -s \*
Invalid login name.

duh!

Regards,
Cedrick Gaillard
Best regards, Cedrick Gaillard
G V R Shankar
Valued Contributor

Re: NO Password

Hi,

logins -p will give you the list of users, that doesn't have password.

Ravi.
gogleboy
Occasional Advisor

Re: NO Password

Thanks lot dear friends...

OldSchool
Honored Contributor

Re: NO Password

Mobidyc said: "duh!"

In my defense, I *said* I wasn't able to check it....after looking at the online "man" page, what I should have said was:

as root on non-trusted system, run:

passwd -s -a

oh, well....
mobidyc
Trusted Contributor

Re: NO Password

Hey OldSchool,

I said duh! but it was not pejorative.
Please don't think it had a critical meaning.

Best regards,
Cedrick Gaillard.
Best regards, Cedrick Gaillard