密码老化是否会影响Linux中的locking帐户?

我有一个要求将几个Linux帐户的maxdays设置更改为365,大多数帐户被locking。

密码老化设置是否影响这些帐户? 我担心的是我会把它们改成365(现在很多是99999或-1),一年之后,一些使用它们的过程不会再起作用或者不再起作用了。

看起来如果使用过期的用户帐户,服务仍然可以启动。 例如:

[vagrant@localhost ~]$ sudo usermod --lock --expiredate 1970-02-02 apache [vagrant@localhost ~]$ sudo chage -l apache Last password change : Nov 15, 2014 Password expires : never Password inactive : never Account expires : Feb 02, 1970 Minimum number of days between password change : -1 Maximum number of days between password change : -1 Number of days of warning before password expires : -1 [vagrant@localhost ~]$ sudo service httpd stop Stopping httpd: [ OK ] [vagrant@localhost ~]$ ps -ef | grep apache vagrant 4444 2503 0 14:52 pts/0 00:00:00 grep apache [vagrant@localhost ~]$ sudo service httpd start Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName [ OK ] [vagrant@localhost ~]$ ps -ef | grep apache apache 4459 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd apache 4460 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd apache 4461 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd apache 4462 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd apache 4463 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd apache 4464 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd apache 4465 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd apache 4466 4457 0 14:52 ? 00:00:00 /usr/sbin/httpd vagrant 4468 2503 0 14:52 pts/0 00:00:00 grep apache 

由于这只是一个产品的testing,它并不certificate这是适用于所有的软件产品。

最安全的解决scheme是通过执行ps -ef | grep username来检查某些将要过期的用户是否被进程使用 ps -ef | grep username 。 如果用户没有被进程使用,那么设置到期date似乎是安全的。 否则,请勿设置过期date或更换用户。 如果本地用户用于运行进程,则后者不应该是必需的。 为什么apache分配一个失效date,并决定由另一个用户运行httpd而不是apache