LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2012, 11:39 PM   #1
sheelavantar
Member
 
Registered: Aug 2010
Posts: 69

Rep: Reputation: 1
"chage" command query


Hi All,
I would like to know the meaning of "chage -M 0".

When maxdays value is set to zero for a perticular user password, the "chage -l" command shows that the password will never expire. But it's getting expired in 24 hours.

1.Then waht is the meaning of this value zero here?

2.what is the range for MAXDAYS ?

3. How can disable password expiry for a perticular user using this command?

Please help me find the answers for my questions.

Thank You.
Warm Regard,
Vijay S.
 
Old 01-12-2012, 11:46 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
The questions you present sound like "theoretical" questions--as though someone is trying to make sure you understand how a command works. And that's usually in an instructional environment. I could be wrong, but because that's my impression, I'll give you a link. All your questions can be answered by reviewing the

chage(1) man page

If, after you read that page you still do no know the answers or do not understand what the man page is saying, post back with a question describing what you don't understand.

EDIT:
Some egg on my face... the man page does not specify what the absolute maximum value of MAXDAYS can be, but I've got a strong suspicion what it is...

Last edited by Dark_Helmet; 01-12-2012 at 11:49 PM.
 
Old 01-13-2012, 12:22 AM   #3
sheelavantar
Member
 
Registered: Aug 2010
Posts: 69

Original Poster
Rep: Reputation: 1
Thanx for your reply.

I have understood the command. when I set the MAXDAYS as zero, the password will be valid for 24 hours, because after 24 hours only the MAXDAY value will become 1Day and the password/account will not be active after that.

But I am confused by the output of "chage -l" command.

please check the below output.
bash-2.05a# chage -M 0 vijay
bash-2.05a# chage -l vijay
Minimum: 0
Maximum: 0
Warning: 7
Inactive: 0
Last Change: Jan 14, 2012
Password Expires: Never
Password Inactive: Never
Account Expires: Never
bash-2.05a# date
Fri Jan 13 20:12:38 LST 2012
bash-2.05a#

Even though the password/account will be active for next 24 hours the "chage -l" command shows that the password will Never expire. which is wrong.

Please let me know your opinion.
 
Old 01-13-2012, 12:44 AM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Well, that specific problem does not occur on my system (Debian 6.0.3):
Code:
root@localhost# chage -l nobody
Last password change					: Nov 17, 2011
Password expires					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires	: 7
root@localhost# chage -M 0 nobody
root@localhost# chage -l nobody
Last password change					: Nov 17, 2011
Password expires					: Nov 17, 2011
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: 0
Maximum number of days between password change		: 0
Number of days of warning before password expires	: 7
root@localhost# chage -M -1 nobody
root@localhost# chage -l nobody
Last password change					: Nov 17, 2011
Password expires					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: 0
Maximum number of days between password change		: -1
Number of days of warning before password expires	: 7
root@localhost# chage -M 99999 nobody
root@localhost# chage -l nobody
Last password change					: Nov 17, 2011
Password expires					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires	: 7
Based on the text of the chage man page, using "-M 0" essentially says that the next time the user logs in, they need to change their password. The fact that your system does not seem to recognize that change until the next day implies (to me) that your system probably has a daily scheduled job to check user password status. Such a situation would also explain why your "chage -l" commands to not reflect a change from "never"--because the password information may not be updated.

Keep in mind, that is speculation on my part. The output of your chage command does not match mine. The behavior of your chage does not match mine. By definition, all I can do is speculate as to why your system is behaving the way it is when I have no way to reproduce it on my end.

EDIT:
I wanted to find out what version of chage comes with Debian 6.0.3 so I did a Google search. I did not find that specific information, but I did find an old Debian bug report. The bug report is not directly relevant to your problem. However, if you look at the responses to the bug, there is an indication that PAM modules may be involved. So that is another avenue for you to consider for your behavior: PAM config.

Last edited by Dark_Helmet; 01-13-2012 at 12:58 AM.
 
Old 01-13-2012, 06:24 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by sheelavantar View Post
Thanx for your reply.

I have understood the command. when I set the MAXDAYS as zero, the password will be valid for 24 hours, because after 24 hours only the MAXDAY value will become 1Day and the password/account will not be active after that.

But I am confused by the output of "chage -l" command.

please check the below output.
bash-2.05a# chage -M 0 vijay
bash-2.05a# chage -l vijay
Minimum: 0
Maximum: 0
Warning: 7
Inactive: 0
Last Change: Jan 14, 2012
Password Expires: Never
Password Inactive: Never
Account Expires: Never
bash-2.05a# date
Fri Jan 13 20:12:38 LST 2012
bash-2.05a#

Even though the password/account will be active for next 24 hours the "chage -l" command shows that the password will Never expire. which is wrong.

Please let me know your opinion.
Are you sure you are running the command properly?
which distro are you using?

As your date is also showing the wrong one. 14th which is supposed to be tomorrow?

here I did the same in my Redhat 5.2 and this is the output

Code:
#chage -M 0 deepak
#chage -l deepak
Last password change                                    : Jan 13, 2012
Password expires                                        : Jan 13, 2012
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 0
Number of days of warning before password expires       : 7
 
Old 01-15-2012, 08:04 PM   #6
sheelavantar
Member
 
Registered: Aug 2010
Posts: 69

Original Poster
Rep: Reputation: 1
Thanx for the replies,
I tested the same on fedora 10 machine and it is working properly.
Now I have to check it on the target system, why it is showing wrong info.

@Deepak: I had changed the system date for testing... that's not a problem.

Thank You guys,

Warm Regards,
Vijay S.
 
  


Reply



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
[SOLVED] When I type "sudo grub" it says "command not found" in Ubuntu 9.10 Live CD. msbstar Linux - Newbie 10 04-01-2020 11:54 PM
Possible "chage" command corrupted after linux build..how do i reinstall? linuxeth123 Linux - Server 3 05-24-2011 12:55 PM
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 07:54 AM
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration