LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 05-12-2007, 01:49 AM   #1
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Rep: Reputation: 30
Password expiration message after logging on?


OK, I know this seems a bit silly but I set my password aging of 30 days intervals and the password expire warning to 10 days. I just booted my PC and the 10 day warning message appeared.

Now question is, how can make a message that will say the exact date/time of the password warning message before I have to change my password again in 30 days??

So instead of having like: "Your Password will expire in 10 days" I need to be like this:

PASSWORD FOR USERACCOUNT WILL EXPIRE ON 22-MAY-2007

Hope to have an outlook on replies...Thanks.

Last edited by as400; 05-12-2007 at 02:03 AM.
 
Old 05-12-2007, 03:07 AM   #2
Oupa
LQ Newbie
 
Registered: Apr 2007
Location: Welkom, South Africa
Distribution: RHL + Mandriva
Posts: 15

Rep: Reputation: 0
password expiry

Hi as400, I can only think of a work around using the chage command in a startup file, which is far from ideal. Assuming you are using the bash shell, add the following line to ~/.bashrc

chage -l userid | grep "Password Expires"

Disadvantage is that it appears every time you logon.
If you only want to see it the first time you logon each day, then code the following.

v_d=$(date "+%d")
[[ -f .pwdexp.$v_d ]] || { chage -l userid | grep "Password Expires" ; rm -f .pwdexp.* ; touch .pwdexp.$v_d ; }

Note the second line is one long line beginning
with [[ and ending with }
This is a bit messy, lets hope someone has a better solution.

It is better not to age the root password as changing it should be a planned and documented event and not happen on the spur of the moment because of aging. Oupa.
 
Old 05-12-2007, 03:15 AM   #3
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Original Poster
Rep: Reputation: 30
NEVER MIND...Its too too much complicated..

thanks for your efforts anyway.
 
Old 05-12-2007, 09:04 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,499

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by as400
NEVER MIND...Its too too much complicated..
So you consider a two line solution is far too complex ?
I'm afraid you have quite unrealistic expectations.

That said, Oupa's script should work with Linux but not with Solaris as I don't think chage has been ported to it.

The equivalent command would be "passwd -s".
 
Old 05-13-2007, 01:10 AM   #5
Oupa
LQ Newbie
 
Registered: Apr 2007
Location: Welkom, South Africa
Distribution: RHL + Mandriva
Posts: 15

Rep: Reputation: 0
Password expire

Thanks jlliagre for the info on passwd, now I have learnt something new. Oupa.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password Expiration Policy bspicer Linux - General 7 05-12-2007 03:26 AM
RHat 9 password expiration send-more-ux Red Hat 3 10-01-2003 05:56 PM
Samba Password Expiration kharris Linux - Software 1 09-22-2003 05:25 AM
Password expiration - help klmn1 Linux - General 1 12-30-2002 11:04 PM
Password expiration klmn1 Linux - Networking 1 12-26-2002 12:08 PM


All times are GMT -5. The time now is 07:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration