Skip to content

Force User to Change Password at First Login

Introduction

Indeed, I was looking for how to force a user to change their password during their first login session. Well, nothing obvious except that if we set an account to expire, the user will then be forced to change their password.

Usage

If you are root, you can specify the user whose account you want to expire as follows:

chsh -s /bin/MySecureShell username

And otherwise, a user can change their shell themselves like this:

chsh -s /bin/MySecureShell