Saturday, July 16, 2011

AIX user administration - pwdadm

The pwdadm command can change passwords in AIX. In addition, pwdadm can display (excluding encrypted passwords) or update a user's flags in /etc/security/passwd. Continuing with Xander's account as a guinea pig, First change his password, and then view his current password attributes. Because his password was just changed, the ADMCHG flag will be set. Change that flag to ADMIN, and restrict the account so that only administrators can update the password going forward. Listing shows the code to perform this task.

Listing Change a user's flag and restrict privileges



 
# pwdadm xander
Changing password for "xander"
xander's New password:
Enter the new password again:

# pwdadm -q xander
xander:
        lastupdate = 1250858719
        flags = ADMCHG

# pwdadm -f ADMIN xander

# pwdadm -q xander
xander:
        lastupdate = 1250858719
        flags = ADMIN

No comments:

Post a Comment