password will expire


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users password will expire
# 1  
Old 02-17-2003
password will eypire

login: TEST7
TEST7's Password:
Your password will expire: Wed Feb 19 14:28:08 2003

How can I the same information become in a script (as example
in the .profile)?????????

My login starts with .profile. These File is a menue with 24 lines and the message " Your password ....." disappear
to the top of the screen and the user can't see the message.

My System is a AIX 4.3.2
All Users are defined with pwdwarntime=7

thanks to all helpful Unix-Cracks
# 2  
Old 02-18-2003
I believe you need someone with a bit more AIX experience than I have (especially since it's been years since I have been on one) but the concept should be the same.

Find your secure password file (try /etc/security/passwd) and look for the lastupdate field.

You should be able to grab out the info from the lastupdate field and using Perl figure out when it will expire.

Check out the info at IBM - password security for more info. Also, you might be able to use some of the information from an old post perl script - changing password

The easy solution is to put a "Hit return to start menu" so they can read any info that may be there before you put the menu out to their screen.
# 3  
Old 02-25-2003
Lightbulb

Thank to RTM,

J have the same idea, to stop the script.
It works good, but the solution is'nt good looking.

Can some where help.
I search a command like this:

test passwdexpired USERNAME

output: your password will expire at .....
# 4  
Old 02-27-2003
the newest status:

in the dir /etc/seurity file passwd
you can find follows entries

TEST7:
password = 9SxsMS2A/vUX2
lastupdate = 1046262871
flags =

for all Users

in the example TEST7

lastupdate is the time in seconds beginning
at 01.01.70 (or 69)
that is the RTC (Real Time Clock)

if you change your password, the lastupdate in seconds will
be there.

what you need is the time in seconds from 01.01.70 to now

(i need a calendar programm from date to date in seconds)

the next step is only a subtraction
# 5  
Old 02-27-2003
Take a look at my datecalc script which has been posted to this site. If you use it together with a little bit of algebra you should be able to do what you want.

I just displayed my system clock and got 1046356359.

datecalc -j $(( (1046356359 / (24*60*60)) + $(datecalc -j 1970 1 1) ))
will display:
2003 2 27
# 6  
Old 02-28-2003
Thank to Perderabo for the script.

But - how can I

display my system clock and got the seconds (1046356359).

Please send me the Command

Many thanks from
Erwin Stocker
# 7  
Old 02-28-2003
In Perl...
Code:
#!/u/bin/perl
# (Your location of Perl may be different)
===========================================
$epoch= time ();
print "$epoch\n";

Output of this....

# ./cd.pl
1046442456 

To get this down to days (if your not worried about how many hours, minutes, seconds...)

#!/u/bin/perl
#
#       checkdate - a script to check a date (how long ago)
#       Parameter 1 is entry from /etc/shadow - 3rd field - SUN OS
#       Created 05/07/02 HOG
# =======================================
# Set up variables
$getepoch= time () /60 /60 /24 ;
($nowepoch, $junk) = split (/\./, $getepoch, 2);
$arguement = $ARGV[0];
$diff=$nowepoch - $arguement;
print "Password reset $diff days ago - $nowepoch - $arguement\n";

Output of this...
# ./checkdate.pl 11989
Password reset 122 days ago - 12111 - 11989

12111 is today, 11989 was 122 days ago

added code tags for readability --oombera

Last edited by oombera; 02-20-2004 at 04:33 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Force to reset password after expire

Hi Lads, I would like place the mechanism of force reset password to user when he login to the server after his password expired. Currently, We are resetting users once in every 60 days using cron job but I am thinking is there any other way to force reset passwords after it expires? I am using... (1 Reply)
Discussion started by: Navkreddy
1 Replies

2. AIX

Would like to get email alerts when user password going to expire

Hello, I am trying to write a shell script, which will send email alerts to Admin/users when users password is going to expire in 15 days. Can you please help me with the script. thank you. (3 Replies)
Discussion started by: Kumar7997
3 Replies

3. Shell Programming and Scripting

Check for Specific Username Password Expire

hey Guys, I haven't posted in a while, But you guys were really helpful alst time. I have had a issue with User Passwords expiring, and since I dont check /var/cron/log on the regular I never know these suers are expiring, making certain nightly jobs not run. With this script, I want to be... (14 Replies)
Discussion started by: gkelly1117
14 Replies

4. AIX

Password Expire Message

Does anyone know if the default message displayed when a users password has expired can be changed? I am just assuming the message below is the default one. If so please tell. Using username "justinxx". justinxx@160.23.12.44's password: WARNING: Your password has expired. You must... (2 Replies)
Discussion started by: juredd1
2 Replies

5. UNIX for Advanced & Expert Users

SFTP password expire error

Hi, I am using sftp in batch script for which all configuration for public/private keys are done and it works fine without asking a password. No issues till this point. Now I the problem I have is that if the password expires/someone changes the authentication keys at reote server then the... (4 Replies)
Discussion started by: coolwade
4 Replies

6. Solaris

Problem with password expire and sudo.

Hi, I have a small problem that I need to address regarding the password expiration for a number of different oracle accounts. Currently I have the MAXWEEKS set to 12 in the /etc/default/passwd file for all accounts. I also have sudo installed on the server and users access the oracle accounts... (2 Replies)
Discussion started by: sparcman
2 Replies

7. Red Hat

set password not to expire

Hi All, Is this true on chage command? -M, MAX_DAYS Passing the number -1 as MAX_DAYS will remove checking a password's validity. Does this means password will not expire anymore? Thanks for any comment you may add. (0 Replies)
Discussion started by: itik
0 Replies

8. Solaris

Set Password Never Expire

Hello I want to set the password for user never expire through the command line. For your information the box is running under Solaris 8 platform. (2 Replies)
Discussion started by: shamsul
2 Replies

9. Shell Programming and Scripting

Password expire

Hi, Is there any way to find out the UNIX user's password expire date?. It'll we helpful to inform the users to change the password before it get expires.(FYI - I am not having only admin previlege.) (1 Reply)
Discussion started by: sharif
1 Replies

10. UNIX for Advanced & Expert Users

Disable password expire in HP UNIX

Hi, How to disable passwd expire in HP UNIX by not using SAM ? In our system SAM have some strange bugs. However due to some reason, we cannot add that patch. B. Rgds Christina (3 Replies)
Discussion started by: christina fung
3 Replies
Login or Register to Ask a Question