我看到很多文件建议chage
在Debian和Ubuntu上使用,但apt-get update && apt-get install chage
没有安装该软件包。例如,
root@ubuntu:~/Desktop# apt-get install chage
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package chage
我发现我需要编辑/etc/shadow
。我到底需要如何编辑root
下面的行,这样我的Linux才不会要求我在每次登录时更改密码?
root@ubuntu:~# cat /etc/shadow
root:$6$U.dnAQ2f$FV$/aF23Yn.sq1BYVjinlI9251nAarzqGKES18RxadV5bTakcfCNYAMljUwSaQZYV0r4MttHF0SFO7ebq3E1m/:0:0:99999:7:::
我按照deong
建议编辑了根线
root:$6$U.dnAQ2f$FV$/aF23Yn.sq1BYVjinlI9251nAarzqGKES18RxadV5bTakcfCNYAMljUwSaQZYV0r4MttHF0SFO7ebq3E1m/:0:0:::::
它仍然在登录时要求输入密码。
我还按照http://www.lifelinux.com/setting-up-password-aging-in-linux/上的说明进行操作:
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
我需要编辑什么才能删除password must be changed
?我也做了chage -I -1 -m 0 -M 99999 -E -1 root
,但是没有帮助。
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: