리눅스에서 계정과 패스워드를 설정한 후, 사용자가 처음 로그인시 자신들의 암호를 변경하도록 하는 방법입니다.

Q. How can I force my Linux users to change their passwords upon the first login under CentOS / Debian Linux?

A. You can use any one of the following command to change user passwords upon the first login:
[a] usermod command - Modify various user account properties including user password expiry information.
Where,

[b] chage command - Change user password expiry information

Task: Use chage command to force users to chage their password upon first login

Use the following syntax:
chage -d 0 {user-name}
# chage -d 0 tom

  • -d 0 : Set the number of days since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY-MM-DD. By setting it to zero, you are going to force user to change password upon first login.

Further readings:

  • man pages usermod and chage


+ Recent posts