Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How to Force User to Change Password at Next Login in Linux

    How to Force User to Change Password at Next Login in Linux

    By RahulJuly 10, 20211 Min Read

    All the Linux systems keeps the users information in /etc/passwd and /etc/shadow files. User password and account aging details are stored in the shadow file. The aging information contains the details of the password change and account status.

    Advertisement

    In this tutorial, you will learn about forcing a user to change their password in Linux. Also will discuss the content stored in the shadow file.

    Force User to Change Password

    We use passwd command to create or change user passwords in Linux systems. It also allows us to expire any user’s password. Once the password is expired, the system will allow users to log in but force them to change their password before getting the shell access.

    You can view user account and password details run below command as sudo privileges account:

    sudo change -l username 
    

    To expire users password, type:

    sudo passwd --expire username 
    

    Replace “username” with the actual user name of your system.

    Force  user to change password in linux

    These commands updates the entries in /etc/shadow file.

    Hopefully, this FAQ is helpful for you.

    password user
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Understanding 2>&1 in Bash: A Beginner’s Guide

    How to Choose the Best Shebang (#!) for Your Shell Scripts

    Modulus Operator (%) in Bash

    Using Modulus Operator (%) in Bash

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.