强制更改密码_如何在首次登录时强制用户更改密码?

强制更改密码

强制更改密码

I have a lot of users in my Linux servers. Security is important for me. I know that one of the important security measure is passwords. The length, complexity, change period etc. How can I force user to change password in first login? We will use change command to force user change password in the first login.

我Linux服务器中有很多用户。 安全对我来说很重要。 我知道重要的安全措施之一是密码。 长度,复杂性,更改期限等。如何强制用户在首次登录时更改密码? 我们将使用change 命令强制用户在首次登录时更改密码。

检查当前状态 (Check Current Status)

We will check current user password status with chage command like below. We will provide the -l option which will list current password policy and related information about given user name. We will list the user name ismail password policy in this example.

我们将使用如下所示的chage命令检查当前用户密码的状态。 我们将提供-l选项,该选项将列出当前的密码策略以及有关给定用户名的相关信息。 在此示例中,我们将列出用户名ismail密码策略。

$chage -l ismail
Check Current Status
Check Current Status
检查当前状态
  • `Last password change` will provide when the password is changed last time

    上次更改密码时将提供“最后更改密码”
  • `Password Expires` will list when the password will expire

    “密码过期”将列出密码过期的时间
  • `Account Expires` will list when the account will be expire

    “帐户过期”将列出帐户过期的时间
  • `Maximum number of days between password change` will list gap between password change

    “两次密码更改之间的最大天数”将列出两次密码更改之间的间隔
  • `Number of days of warning before password expires` will list when the warning to change password will be displayed before password change time.

    当密码更改时间之前显示更改密码的警告时,将列出“密码过期之前的警告天数”。

在首次登录时强制更改用户密码 (Force User Password Change in The First Login)

If we do not provide some time to the user for the password change we can force the user. In order to force the user we will use -d option by providing the time for change password. We will provide 0 day which will force the user to change password.

如果我们没有为用户提供一些时间来更改密码,我们可以强制用户。 为了强制用户,我们将通过提供更改密码的时间来使用-d选项。 我们将提供0天,这将迫使用户更改密码。

$ chage -d 0 ismail
  • chage is the command used to change password policy

    chage是用于更改密码策略的命令

  • -d 0 specifies password must change in 0 days which is first login

    -d 0指定密码必须在0天内更改,这是首次登录

  • test2 is our user the password policy will be applied

    test2是我们的用户,密码策略将被应用

LEARN MORE  Linux Su Command Tutorial With Examples
通过示例了解更多Linux Su命令教程

再次检查状态(Check The Status Again)

We will check if force password change implemented

我们将检查是否实施了强制密码更改

$ chage -l ismail
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

As we see that lines provides password must be changed message.

如我们所见,提供密码的必须更改消息。

如何在首次登录时强制用户更改密码? 信息移植 (How To Force User Change Password Upon First Logon? Infografic)

How To Force User Change Password Upon First Logon? Infografic
How To Force User Change Password Upon First Logon? Infografic
如何在首次登录时强制用户更改密码? 信息移植

翻译自: https://www.poftut.com/force-user-change-password-upon-first-logon/

强制更改密码

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值