Make users change their password at next login in Ubuntu

In this article, we cover how to make users change their password at next login in Ubuntu. We have come across users, who just don’t change their passwords at regular intervals. This behavior puts both the organizations and the user themselves exposed to a security risk. So, for such users we warn them about the risk. And, if such users don’t comply then we can make them change their passwords next time they log in.

The two command-line utilities which we will use are

  1. chage and,
  2. passwd.

Note: Following operations require superuser privileges. Contact your System Administrator for assistance, if you don’t have such privileges.

Make users change their password at next login in Ubuntu

Although there are other methods to make a user change the password. But, here we are just concerned about making them change it at next login. So, we can use any of the following two commands to make them do so –

I. Using chage command-line utility.

sudo chage -d 0 <username>

So, let’s say we have a user abc then,

sudo chage -d 0 abc

We have basically set the user’s last password change days to zero. This effectively make them change password at next login.

II. The second way to achieve similar outcomes is through passwd command-line utility. Use the following syntax –

sudo passwd -e <username>

where, -e is used to instantly expire a user’s password.

In conclusion, whoever has a user account should change their passwords at regular intervals. Here, we covered how to make users change their password at next login in Ubuntu. Apart from that, we can warn user’s about their password change as well as make them change their at regular intervals. We cover both these topics in subsequent articles.

Similar Posts