Removing the password of a user

Hi Experts,

According to the manual if you want to remove the password for a user account the "password" field in /etc/security/passwd should be set to "*"

So instead of this:

password = 6BqaLx8FeI8os

Should be set to this:

password = *

But when I run the following command in my AIX 6.1 box I get this error:

chuser -f /etc/security/passwd -s username -a password=*
3004-692 Error changing "password" to "*" : Attribute is invalid.

Help ???

From man passwd_security (nicely hidden away, thanks IBM)

I don't seem to be able to find a documented way to nullify it. Perhaps a quick and cautious edit would be best.

If the user you are wanting to set a null password for is RBATTE1 (for want of a better example) you can try this:-

echo "/^RBATTE1:\n/password =\n3cwpassword = *^[:wq" | vi /etc/security/passwd

You would be sensible to try this on a copy of the file first to assure yourself that it does what you expect.

The bit in red is a single escape character. It is generated by pressing Cntl-V then Escape whilst typing in the command.

I hope that this helps.

Robin
Liverpool/Blackburn
UK

1 Like

You can try:

echo "<user>:*" | chpasswd -c -e

this will result in

<user>:
        password = *
        lastupdate = 1375447862
2 Likes

you should also be able to directly edit /etc/security/passwd with vi if you wanted to without using chpasswd ...

1 Like

I have to agree to XrAy on this: even though there are ingen�ous ways to "massage" the system to do whatever, like the one rbatte1 has provided, it is generally better to use the provided utilities. This sometimes helps and never hurts.

It is good to know these workarounds (if for no other reason than to know your system better), so i think there is value in rbatte1's contribution, but one should stick to the supported methods as long as possible at any rate. (For the same reason, i.e., i would always use "chinet" to modify lasting routing entries instead of using "route" and then patch them into the ODM, even if i might succeed in doing so.)

I hope this helps.

bakunin

1 Like

thanks everybody.. that helps