Recover - Reset forgotten linux root password - LinuxConfig.org

This method of reseting/recovering of lost Linux root password should work on most of linux distributions. I have tested this method for couple years already, starting with debian woody,redhat and suse to ubuntu .


This is a companion discussion topic for the original entry at https://linuxconfig.org/recover-reset-forgotten-linux-root-password

Olaf

passwd: Authentication token manipulation error
passwd: password unchanged

What to do?

Lubos Rendek Mod -> Olaf

run mount command and check if your / partition is not mounted as read-only

favogiuseppo

I use Manjaro 16.10 xfce, which part of the code should I edit?

There is a typo in remount command:
mount -o remount,rw / mount -o remount,rw /proc

separate mounting of / and /proc with &&:
mount -o remount,rw / && mount -o remount,rw /proc

When it came time for me to type my new password, it wouldn’t let me type anything.

Hi Jonathan_Lenhart,

Welcome to our forums.

When you reach the point of typing the new password, the password you type will not show up on screen - not even replacing asterisks will be shown to indicate how many characters you typed. This is on purpose, and it is so for security reasons. But this does not mean your input is not recorded. You can just type the new password, press Enter, type it again on the next line, press Enter again, and you are done.

Facing the same issue here…
Have passed through all commands, yet getting error.
The mount command is still in rw mode. Or please tell me how to proceed. I’m a novice here.

Hi Emintah92,

Welcome to our forums.

It is the intention of the tutorial to mount the partition in rw (read+write) mode instead of ro (read only) - otherwise you would not be able to modify the root password.

I have newly installed linux Mint Cinnamon version. after installing and creating password wheni attempt to enter the password to start linux i get this message :“Invalid password, please try again”. I have carefully followed the instructions several times to reset the root password and i still get the same message. Can you help me?

Hi Cshart,

Welcome to our forums.

Since Mint is a Debian-based distribution, my first guess would be that the password you need to enter to start is your own user’s password, not root user’s password. That is, if by “start linux” you mean starting a graphical session on the running operating system. In general the graphical session should be running in the name of a normal user, not root. This is so for security reasons.

I had not turned on my Linux computer for several months, and in the process of not using it forgot the “su” (superuser – I reckon this is also the root user?) password. I have executed these instructions twice. When I attempt to run “sudo apt update” and am asked for the password, the OS’s response is “Sorry, try again.” I am running the same setup as Cshart (Linux Mint with Cinnamon desktop). Is there something more to know about how to set a new password that will enable me to use my machine, short of reinstalling the OS? (Reinstalling the OS is an option, as I have been mainly using Windows 10 for personal activities and a Macbook [MacOS] for my work. I now have some development-related learning to do that requires Linux and no, I don’t want to use WSL or MSYS2.)

Hi Ghenry740,

Welcome to our forums.

On Debian based systems, your normal user is a sudoer, so you need your normal user’s password to execute a sudo command (the password you use to log in to the GUI).
If you followed this guide, you changed the root user’s password, so you can execute superuser commands by switching to the root user with the below command:

$ su - root

And enter the root user’s password to gain a superuser session. Just don’t forget to log out of the superuser session when you are done, commands that are harmless in a normal user session can do a lot of damage when executed from a root session.