Score:-2

Recover root password on debian

us flag

I lost root password for Debian server. it's runing very important services like radius server and wifi controller How I can recover password without lose data?

Romeo Ninov avatar
in flag
Reset the password (need restart/downtime). Or try to use `sudo` if configured.
Score:2
ar flag

If the boot loader isn't locked you can hit e to edit the entry and append init=/bin/sh to the kernel line, herewith an example: GRUB boot loader

ie: Append init=/bin/sh to the end of the linux line (most probably multiple lines)

You should then land on a '# ' prompt but be aware that the root filesystem will be mounted read-only (if you run 'mount' it will say something like '/dev/sda3 on / type xfs (ro,' (ro = read only).

Remount the file system in read write mode by entering: mount -o remount,rw /

Unlock the 'root' account: passwd -u root Change the 'root' account password: passwd root Flush pending writes: sync Remount the file system in read only mode again: mount -o remount,ro / Exit the shell: exit

The system will then show a kernel panic, as 'init' just exited. Simply reset and then login with your reset credentials.

sentadoensilla avatar
us flag
Great answer. really was it. Althougth the hard disk was damaged and this huge bug was the problem main
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.