admin管理员组文章数量:1648301
今天用xshell登录服务器的时候,突然发现登录不了了,用户名和密码肯定是对的。xshell上也没有报密码错误,直接闪退了。
后来用root用户登录服务器,修改用户密码,报了一个错误,User account has expired。google了一下,大致意思就是说账户密码过期了,所以不能登录了。
google了一些解决办法,可以通过chage密码来解决
首先查看一下root用户的信息
A0304003:~ # chage -l root
Minimum: -1
Maximum: -1
Warning: -1
Inactive: -1
Last Change: May 16, 2013
Password Expires: Never
Password Inactive: Never
Account Expires: Never
再查看一下登录不了的用户信息
A0304003:~ # chage -l hello
Minimum: 0
Maximum: 360
Warning: 7
Inactive: 7
Last Change: Jan 06, 2014
Password Expires: Jan 01, 2015
Password Inactive: Jan 08, 2015
Account Expires: Never
从上面的信息可以看到,hello这个用户密码如果360天不修改就不能登录了
我们通过chage命名,把相关值设置的和root一样
A0304003:~ # chage hello
Changing aging information for hello.
Minimum Password Age [-1]: -1
Maximum Password Age [1]: -1
Password Expiration Warning [-1]: -1
Password Inactive [-1]: -1
Last Password Change (YYYY-MM-DD) [2014-01-06]:
Account Expiration Date (YYYY-MM-DD) [1969-12-31]: -1
Aging information changed.
A0304003:~ # chage -l hello
Minimum: -1
Maximum: -1
Warning: -1
Inactive: -1
Last Change: Jan 06, 2014
Password Expires: Never
Password Inactive: Never
Account Expires: Never
这样hello的账户密码就不会过期了,但是这样设置后还不能用hello这个账户登录,还需要通过passwd这个命令对hello这个账户再设置一下密码。
版权声明:本文标题:User account has expired 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1729498081a1203149.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论