Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I see a lot document suggest to use chage on debian and ubuntu, apt-get update && apt-get install chage does not install the package, e.g.

root@ubuntu:~/Desktop# apt-get install chage
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package chage

I found that I need to edit /etc/shadow how exactly I need to edit root line below, so that my linux does not ask my to change the password on the each log in?

root@ubuntu:~# cat /etc/shadow

I edited the root line as deong suggested


It stills asks password on the log in

I also followed the instructions on

root@ubuntu:/home# chage -m 7 -M 60 -W 7 -I 7 root
root@ubuntu:/home# chage -m 0 -M 99999 -I -1 root
root@ubuntu:/home# change -l root
-bash: change: command not found
root@ubuntu:/home# chage -l root
Last password change                                    : password must be changed
Password expires                                        : password must be changed
Password inactive                                       : password must be changed
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

what do I need to edit to remove password must be changed? I also did chage -I -1 -m 0 -M 99999 -E -1 root but it did not help

share|improve this question

migrated from Apr 2 '13 at 16:25

This question came from our site for professional and enthusiast programmers.

up vote 5 down vote accepted
$ man 5 shadow

describes the format of that file. Quoting from there, the fifth field is the maximum password age.

maximum password age The maximum password age is the number of days after which the user will have to change her password.

After this number of days is elapsed, the password may still be valid. The user should be asked to change her password the next time she will log in.

An empty field means that there are no maximum password age, no password warning period, and no password inactivity period (see below).

If the maximum password age is lower than the minimum password age, the user cannot change her password.

In your case, you've already hit the trigger, so you also need to get rid of the prompt to immediately change the password on the next login. Again consulting the man page...

date of last password change The date of the last password change, expressed as the number of days since Jan 1, 1970.

The value 0 has a special meaning, which is that the user should change her password the next time she will log in the system.

An empty field means that password aging features are disabled.

So you should also delete the zero from the third field. And once you've disabled that, there's no need for the fourth one either.

So you should be able to delete the fifth field entirely to achieve what you want. As in


That said, I would generally advise against directly editing files like this unless you're 100% sure you know what you're doing.

Edit: Also, it appears that chage is part of the passwd package on Ubuntu, which I would have assumed you already had installed.

share|improve this answer
I edited the line as you did but I still get ubuntu login: root Password: You are required to change your password immediately (root enforced) Changing password for root. (current) UNIX password: Enter new UNIX password: Retype new UNIX password: – user177439 Apr 2 '13 at 15:16
do you know if I need to edit another file as well to disable password expiration? – user177439 Apr 2 '13 at 15:26
Sorry...I didn't read closely enough. I've edited my answer to include a bit more. Note that all of this is clearly laid out in the man page. – deong Apr 2 '13 at 15:57
Now it works, thank you deong! – user177439 Apr 2 '13 at 16:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.