Sponsored Content
Operating Systems AIX How to check password expiry in AIX? Post 302252801 by shockneck on Thursday 30th of October 2008 10:35:47 AM
Old 10-30-2008
You need to be root to do this but there is no single command available. From the /etc/security/passwd you get the information when the password for a particular user was set ("lastupdate"). You'd then check the user's attributes to find the intervall for a forced password change. With those two values and the current date you can calculate when the current password will be expired. Thus a script would probably be written around the following commands:

Code:
[server:root] /etc/security > grep -p shockneck passwd
shockneck:
        password = GaKaqDbvE3Q.s
        lastupdate = 1223451491
        flags =

[server:root] /etc/security > perl -le 'print scalar localtime 1223451491'
Wed Oct  8 09:38:11 2008
[server:root] /etc/security >  lsuser -a maxage shockneck
shockneck maxage=13
[server:root] /etc/security >  date
Thu Oct 30 15:26:32 MEZ 2008
[server:root] /etc/security >

Search the script forum to find how to convert a date into seconds from epoch for easy comparison. You might even find several complete scripts there for accomplishing your aim.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

password expiry

Hi, under SUN Unix, in which file the expiry date of a user password is indicated ? Many thanks. (2 Replies)
Discussion started by: big123456
2 Replies

2. Solaris

Notification of password expiry.

Hi, Is there any way of sending an email to a number of users indicating that the passwords of user accounts will expire? Currently we have a test server with a number of oracle test accounts on it. Each of these accounts correspond to an instance of Oracle on the server. These... (2 Replies)
Discussion started by: sparcman
2 Replies

3. Solaris

Notification of password expiry.

Hi, Is there any way of sending an email to a number of users indicating that the passwords of user accounts will expire? Currently we have a test server with a number of oracle test accounts on it. Each of these accounts correspond to an instance of Oracle on the server. These... (2 Replies)
Discussion started by: sparcman
2 Replies

4. Solaris

SSH Password-less login fails on password expiry.

Hi Gurus I have a few Sol 5.9 servers and i have enabled password less authentication between them for my user ID. Often i have found that when my password has expired,the login fails. Resetting my password reenables the keys. Do i need to do something to avoid this scenario or is this... (2 Replies)
Discussion started by: Renjesh
2 Replies

5. Shell Programming and Scripting

password expiry notification

Hi, Could someone please let me know how to write script for passwd expiry notification on salaries boxes. Regards Dnyan (1 Reply)
Discussion started by: dnyan
1 Replies

6. Solaris

disable password expiry

Hi How do i disable password expiration on ldap? It runs on Solaris 10 machine. Thanks in advance. (3 Replies)
Discussion started by: hrist
3 Replies

7. Shell Programming and Scripting

Password expiry date check for hp servers

Hi All, Can anybody help me, to find the command to check for the password expiry date for the hp servers. Thanks, Deepak (3 Replies)
Discussion started by: dswain
3 Replies

8. Shell Programming and Scripting

Password expiry report

Hi All, I want to write a script that will send the alert when linux server password expiry for user 'x' is less than 12 days. I have written the below script but this is not working for expiry date 04 july script;- P_EXPIRY_DATE=`chage -l msdp| grep 'Password expires' | awk ' {... (2 Replies)
Discussion started by: abhigrkist
2 Replies

9. Solaris

Command to find out password expiry

Hi, I would like to know is there command which will tell me when password will be expire and when last password was changed ? like on linux chage -l <username? (2 Replies)
Discussion started by: manoj.solaris
2 Replies

10. AIX

UNIX cmd to check for non expiry type password

Hi, Here's the version of unix that we are working on. > uname -a AIX yyyyyyyy 1 6 00F613E24C00 @:on(cluster303)/iishomea/kmani00-> i have application id: aaabbb Now i need to check whether the password for the application id set to non expiry type or not. Moreover, with that unix... (3 Replies)
Discussion started by: kmanivan82
3 Replies
CHAGE(1)						      General Commands Manual							  CHAGE(1)

NAME
chage - change user password expiry information SYNOPSIS
chage [-m mindays] [-M maxdays] [-d lastday] [-I inactive] [-E expiredate] [-W warndays] user chage -l user DESCRIPTION
chage changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change her password. The chage command is restricted to the root user, except for the -l option, which may be used by an unprivileged user to determine when her password or account is due to expire. With the -m option, the value of mindays is the minimum number of days between password changes. A value of zero for this field indicates that the user may change her password at any time. With the -M option, the value of maxdays is the maximum number of days during which a password is valid. When maxdays plus lastday is less than the current day, the user will be required to change her password before being able to use her account. This occurance can be planned for in advance by use of the -W option, which provides the user with advance warning. With the -d option, the value of lastday is the number of days since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area). The -E option is used to set a date on which the user's account will no longer be accessible. The expiredate option is the number of days since January 1, 1970 on which the accounted is locked. The date may also be expressed in the format YYYY-MM-DD (or the format more com- monly used in your area). A user whose account is locked must contact the system administrator before being able to use the system again. The -I option is used to set the number of days of inactivity after a password has expired before the account is locked. The inactive option is the number of days of inactivity. A value of 0 disables this feature. A user whose account is locked must contact the system administrator before being able to use the system again. The -W option is used to set the number of days of warning before a password change is required. The warndays option is the number of days prior to the password expiring that a user will be warned her password is about to expire. If none of the options are selected, chage operates in an interactive fashion, prompting the user with the current values for all of the fields. Enter the new value to change the field, or leave the line blank to use the current value. The current value is displayed between a pair of [ ] marks. NOTE
The chage program requires shadow password file to be available. Its functionality is not available when passwords are stored in the passwd file. FILES
/etc/passwd - user account information /etc/shadow - shadow user account information SEE ALSO
passwd(5), shadow(5) AUTHOR
Julianne Frances Haugh <jockgrrl@ix.netcom.com> CHAGE(1)
All times are GMT -4. The time now is 05:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy