Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-12-2007, 01:49 AM
|
#1
|
|
Member
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596
Rep:
|
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.
|
|
|
|
05-12-2007, 03:07 AM
|
#2
|
|
LQ Newbie
Registered: Apr 2007
Location: Welkom, South Africa
Distribution: RHL + Mandriva
Posts: 15
Rep:
|
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.
|
|
|
|
05-12-2007, 03:15 AM
|
#3
|
|
Member
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596
Original Poster
Rep:
|
NEVER MIND...Its too too much complicated..
thanks for your efforts anyway.
|
|
|
|
05-12-2007, 09:04 AM
|
#4
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
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".
|
|
|
|
05-13-2007, 01:10 AM
|
#5
|
|
LQ Newbie
Registered: Apr 2007
Location: Welkom, South Africa
Distribution: RHL + Mandriva
Posts: 15
Rep:
|
Password expire
Thanks jlliagre for the info on passwd, now I have learnt something new. Oupa.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:26 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|