System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.â„¢   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Force a password change on the next login

Last updated on:  2020-09-22

Authored by:  James Andrade


This article describes how to make users change their password on their next login.

You can do this by using either the chage (change age) or passwd (password) command.

chage

The following example demonstrates creating a user and using the chage command to force a password change:

Create user:
~]# useradd testuser1
[root@localhost ~]# passwd testuser1
Changing password for user testuser1.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

Set expiration:
~]# chage -d 0 testuser1

Testing:
~]$ su - testuser1
Password: 
You are required to change your password immediately (administrator enforced)
Current password: 
New password: 
Retype new password: 
[testuser1@localhost ~]$ 

passwd

The following example demonstrates creating a user and using only the passwd command to force a password change:

Create user:
~]# useradd testuser2
~]# passwd testuser2
Changing password for user testuser2.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

Set expiration:
[root@localhost ~]# passwd -e testuser2
Expiring password for user testuser2.
passwd: Success

Testing:
~]$ su - testuser2
Password: 
You are required to change your password immediately (administrator enforced)
Current password: 
New password: 
Retype new password: 
[testuser2@localhost ~]$ 

Either option forcing users to change their password the next time they log in.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.