• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Browsers
    • Gaming
    • Hardware
    • Internet
    • iPhone
    • Linux
    • macOS
    • Office
    • Reviews
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About
Linux Passwords: How To Force a User To Reset Their Password

Linux Passwords: How To Force a User To Reset Their Password

February 7, 2021 by Mel Hawthorne Leave a Comment

If you manage a Linux machine with multiple users, you may occasionally want or need to get a user to change their password. The most likely cause for this requirement is for a first-time use scenario. Other potential reasons to change a password such as a user forgetting it, the password being compromised, or mandatory regular password cycling, don’t really work with the concept of manual password expiry.

When a Linux password is expired, the user is required to change it the next time that they log in. If a user has forgotten their password, they’ll never be able to sign in to then get to change their password. If a user’s password is compromised it should be changed immediately; expiring it runs the risk that the hacker signs into the account first and can then set the password to any value. If you have a policy of requiring regular password resets, then this should be managed automatically by setting a maximum password age rather than manually expiring passwords.

Note: Ideally you shouldn’t regularly expire passwords anymore, the NCSC and NIST as well as the larger cybersecurity community have changed their public guidance due to research that showed that doing so makes people more likely to choose weak and formulaic passwords. The guidance is now to only make users change passwords when there is a reasonable suspicion that the password has been compromised. By not forcing users to regularly remember new passwords, they are more likely to create and remember a longer, more complex, strong password.

When you first create an account for a user, typically it is created with a temporary password. The user should then change this password to something they can remember the first time that they sign in.

How to force expire a password

To mark a password as “expired” and to force the user to change their password the next time that they log in you want to use the command “passwd” along with the “-e” flag. The “-e” flag immediately expires an accounts password which will force them to change their password the next time that they log in.

The full command would be “sudo passwd -e [username]”. Sudo is required as the command required root permissions to run.

The command “sudo passwd -e [username]” immediately expires the specified user’s password, forcing them to change it the next time that they log in.
Password security is incredibly important, and not just on a Windows machine – be sure to often change your (and other users) passwords, so that nobody can gain unauthorised access to their accounts.

You Might Also Like

  • Linux Passwords: How to Set a Password to Expire
    Linux Passwords: How to Set a Password to Expire
  • Slack: How to Force All Members of Your Workspace to Change Their Password
    Slack: How to Force All Members of Your Workspace to Change…
  • Linux Mint: How to Add a New User
    Linux Mint: How to Add a New User
  • Should Users Be Forced to Reset Their Passwords Regularly?
    Should Users Be Forced to Reset Their Passwords Regularly?
  • Linux Mint: How to Change Your Password
    Linux Mint: How to Change Your Password
  • PowerShell: Check When User Last Set Active Directory Password
    PowerShell: Check When User Last Set Active Directory…

Filed Under: Internet

Reader Interactions

Did this help? Let us know!

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

Recent Posts

  • How to View Facebook Memories in 2023
  • How to Fix Google Maps Voice Directions Not Working
  • What Happens to Messages When You Permanently Delete Facebook
  • How to Connect Bluetooth Headphones to Steam Deck
  • How to Reset Root Password on Steam Deck
  • How to Update Steam Deck
  • Fixed Error Code: Out of Memory on Windows 11 Web Browsers
  • How to Play Minecraft on Chromebooks

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

You May Also Like

  • Linux
  • One-Time Password

© Copyright 2023 Guiding Tech Media · All Rights Reserved · Privacy