Network Computing is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Linux Clues: Lost Password? No Problem!

What if one day you sat down to your computer, and couldn't remember your user password? It could happen. Senior moments, blonde moments, Mom's-heimers -- call it what you will -- but every so often the humans among us lose random bits of data. And, because it's bad security (or rather no security) to write down your passwords, here's how you can login despite the forgotten password.

IMPORTANT: The tips in this document require the use command-line commands. For more information about how to read and execute Linux command-line prompts and commands, please check the Linux Clues' Linux Cheat Sheet, especially Linux Prompt Basics and Linux Command-Line Nomenclature.

Lost User Password
So you forgot your user password, eh? The following steps assume you've forgotten your user password but remember your root password. If you don't remember your root password, skip down to that section.

Start by logging in as root. (If you're not sure how to do that, read Logging in and out as Root in the Linux Clues' Linux Cheat Sheet) Next, open a terminal or console and type the three lines that follow. (Remember, don't type the pound symbol, that shows you're logged in as root.)

# passwd {type your username here without the curly brackets}
Type in a new password    (Ignore the error message you'll probably get.)

  • 1