为了安全起见,我只希望 root 更改所有其他用户的密码。如果我将 /usr/bin/passwd 设置为 700,这将实现。现在,如果启用密码老化或启用首次登录,当用户使用成功或过期的密码登录时,他们会被要求选择一个新密码,即我想禁用。
输出:
login as: test
Using keyboard-interactive authentication.
Password:
Using keyboard-interactive authentication.
Password change requested. Choose a new password.
Enter current password:
Run Code Online (Sandbox Code Playgroud)
预期输出:
login as: test
Using keyboard-interactive authentication.
Password:
Using keyboard-interactive authentication.
Your password has expired. Please contact root to change your password.
Run Code Online (Sandbox Code Playgroud)
我想要任何解决方法来实现这一目标。