• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

Force linux user to change password upon login

December 18, 2013 by Sharad Chhetri Leave a Comment

Force linux user to change password upon login

In this tutorial we will learn how to force linux user to change the password upon login. There are two commands through which we can force user to change password upon first login or login.You can use any of the either command.

Note: Login as root to run these commands. If non-root user have sudo access then use sudo before these commands.
eg. sudo chage -d 0 user_name OR sudo passwd -e user_name

Command 1: By using chage command

Syntax:

chage -d 0 user_name

Example: Here the user name is sharad

chage -d 0 sharad

Command 2: You can also use passwd command

Syntax:

passwd -e user_name

Example: Here the user name is sharad

passwd -e sharad

After running any of the above given two commands.Logout and then login with user.On giving login password it will ask to reset new password.First give old password then give new password and reconfirm new password.(As per the message you will see on terminal or console)

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Linux: Set user password by using encrypted password in command
  2. lock user login after failed login attempts in Red Hat 6.x and CentOS 6.x
  3. Temporarily change the shell after login
  4. How to show user account password expiration detail on Linux
  5. How to change login banner message in GUI mode in CentOS 6 or above version.
  6. How to delete password of user in Linux
  7. How to increase Password Expire date without resetting the password
  8. How to set user postgres password in postgresql 9.1
  9. Password prompt in single user mode is not secure : CentOS/Red Hat
  10. ghost blog reset password and activate user from sqlite

Filed Under: Linux Commands Tagged With: chage, linux command, passwd

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

4 Different commands to find system uptime in linux

Non interactive ,without typing password do ssh to Server : By sshpass

How to see line numbers in file through cat command

How to install pam_mysql in CentOS or Red Hat

How to backup and restore iptables on Linux systems

Allow wget and yum in iptable

find command to search keyword in files recursively in linux

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy