Command to find out password expiry


 
Thread Tools Search this Thread
Operating Systems Solaris Command to find out password expiry
# 1  
Old 02-04-2013
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  
Old 02-05-2013
Code:
grep "^${LOGNAME:-$USER}:" /etc/shadow | perl -a -F: -ne '  
printf "%-10s%d\n","Minimum:",$F[3];
printf "%-10s%d\n","Maximum:",$F[4];
printf "%-10s%d\n","Warning:",$F[5];
printf "%s %s\n","Last Change:",scalar localtime($F[2]*3600*24);
printf "%s %s\n","Password Expires:", scalar localtime(($F[2]+$F[4])*3600*24);
'

You might need to
Code:
sudo grep ...

or use Solaris RBAC to elevate rights to read /etc/shadow.
# 3  
Old 02-05-2013
Code:
passwd -s username

This User Gave Thanks to bartus11 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. SuSE

Disable the password expiry date

Hi, We are going to create the new user, using that user we are automate the work, but every 90 days password get expired how can i create or avoid the expiry the password. (1 Reply)
Discussion started by: kingganesh04
1 Replies

5. 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

6. 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

7. UNIX for Dummies Questions & Answers

Find user password expiry date

Does anyone know a simple way to find out the expiry date of my UNIX user password? I do not have root access to the box. Surely there is a way to so this... (4 Replies)
Discussion started by: oztoma
4 Replies

8. 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

9. Solaris

Emailing about password expiry for a user

How to create a mechanism that e-mails user/admin before password expiry. Assume 7 days in advance. Thanks in advance for your great help. Regards, Awadhesh (4 Replies)
Discussion started by: Awadhesh
4 Replies

10. 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
Login or Register to Ask a Question