Removing the password of a user


 
Thread Tools Search this Thread
Operating Systems AIX Removing the password of a user
# 1  
Old 08-01-2013
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:
Code:
password = 6BqaLx8FeI8os

Should be set to this:
Code:
password = *

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

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

Help ???

Moderator's Comments:
Mod Comment Use code tags please, see PM.

Last edited by zaxxon; 08-02-2013 at 08:23 AM.. Reason: code tags
# 2  
Old 08-02-2013
From man passwd_security (nicely hidden away, thanks IBM)
Quote:
password Specifies the encrypted password. The system encrypts the password
created with the passwd command or the pwdadm command. If the password is empty,
the user does not have a password. If the password is an * (asterisk), the user
cannot log in. The value is a character string. The default value is *.
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:-
Code:
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

Last edited by rbatte1; 08-02-2013 at 08:19 AM.. Reason: Pressed submit too early!
This User Gave Thanks to rbatte1 For This Post:
# 3  
Old 08-02-2013
You can try:

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

this will result in
Code:
<user>:
        password = *
        lastupdate = 1375447862

These 2 Users Gave Thanks to -=XrAy=- For This Post:
# 4  
Old 08-04-2013
you should also be able to directly edit /etc/security/passwd with vi if you wanted to without using chpasswd ...
This User Gave Thanks to Just Ice For This Post:
# 5  
Old 08-04-2013
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
This User Gave Thanks to bakunin For This Post:
# 6  
Old 08-04-2013
thanks everybody.. that helps
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to scp File from root user in one server to say crt user in another server and avoid password?

Can someone help in writing some script through which I can transfer file (scp) from root user in abc server to crt user in hfg server and can give the crt user password in script itself so that it doesn't prompt me every time for password (4 Replies)
Discussion started by: Moon1234
4 Replies

2. Solaris

remove a user without removing its home dir

HI all, I have wrongly given a wrong home directory to a user. This dir is very critical for my production environment(Can;t afford to lose it for a single minute) Now i want to delete that user, Whenever i try to delete user it tries to delete its home dir. Commnd i use: userdel ... (9 Replies)
Discussion started by: varunksharma87
9 Replies

3. Shell Programming and Scripting

Removing old user directories that are no longer Users in /etc/passwd

I am new to shell scripting, and have not done much programming in several years. So I am very rusty at this at best. I know my way around the linux command line, but actually scripting is something I have not done too much of. I have been tasked to come up with a script that will pull all... (5 Replies)
Discussion started by: shuiend
5 Replies

4. UNIX for Dummies Questions & Answers

Removing a user that doesnt exist from a group

Hi there, normally if I want to remove a user tht I have added to a specific group, i would do the following this is what my group2 looks like # grep group2 /etc/group group2:x:7777:user2,user1,user4 user1 has been defined in a few groups # id -nG user1 group1 group2 group3 So... (3 Replies)
Discussion started by: rethink
3 Replies

5. Shell Programming and Scripting

Removing user access using user id

I have multiple .prm files that contain user ID's. The .prm files reside in multiple directories that allow users access to different areas of the system. (see below) current directory /apps/fourgen/accounting/menu drwxrwxrwx 16 phil infotech 512 Sep 7 2002 apmenu... (8 Replies)
Discussion started by: jamba1
8 Replies

6. UNIX for Dummies Questions & Answers

User Name and Password List/adding and removing users.

Hello everyone and let me start off by thanking anyone who can help with this. I work for a company that uses Unix as one of their servers. I'm not at all familar with Unix beyond logging after I restart the server:rolleyes: I'm looking for some command that will bring me up a list of current... (3 Replies)
Discussion started by: disgracedsaint
3 Replies

7. UNIX for Advanced & Expert Users

password verification verify password of a user for only first 8 characters

Helo , I m using linux pam library for user and its password authentication. I m creating new user and giving its password.I m giving password of 10 characters.now when I login in as that newly created user its ask me $ su - ram Password: You are required to change your password immediately... (12 Replies)
Discussion started by: amitpansuria
12 Replies

8. UNIX for Dummies Questions & Answers

removing a user with hidden files

Hello, I am trying to remove an employing from our database, I have removed all her files but can't remove the directory because of the hidden files. How do I remove the user? Thanks, (1 Reply)
Discussion started by: nov_user
1 Replies

9. Solaris

Removing user from multiple groups via command line

Want to know if any, a command line parameter(s) of removing a user from multiple groups without using any ineractive application? (1 Reply)
Discussion started by: jquizon62
1 Replies
Login or Register to Ask a Question