Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    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

    RahulBy 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.

    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
    Previous ArticleHow to Read, Write & Parse JSON in Python
    Next Article How To Set/Create Environment and Shell variables in Linux

    Related Posts

    What is the /etc/aliases file

    2 Mins Read

    What is the /etc/nsswitch.conf file in Linux

    2 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    How to Delete a Let’s Encrypt Certificate using Certbot

    Updated:June 3, 20222 Mins Read

    How to Install Latest Git on Ubuntu 22.04

    Updated:May 31, 20222 Mins Read

    How To Install LibreOffice on Ubuntu 22.04

    Updated:May 23, 20222 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    • What is difference between var, let and const in JavaScript?
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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