LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Forgotten Sudo & Root Passwords (https://www.linuxquestions.org/questions/linux-newbie-8/forgotten-sudo-and-root-passwords-4175571933/)

arranskye 02-10-2016 06:50 PM

Forgotten Sudo & Root Passwords
 
Sorry, I know there are several posts in general and in various forums relating to re-setting forgotten passwords. I have re-set passwords myself and kept written instructions to use but this time nothing appears to work.
Grub/recovery/root For example a user named sally ls /home passwd sally produces "Give root PW for maintenance or type Control D to continue. Typed in Control D pressed enter and the command was just repeated. Nowhere to try mount -rw -o remount /

no point in being asked for the Root PW when that plus the sudo pw is what I have forgottten. Please help. Thanks. its a couple of years since I have used the grub menu and that has also changed. I tried grub.edit to mount/remount but that did not work.
Also tried grub/recovery/edit with the intention of appending the linux line with rw init=/bin/bash at the end. press Ctrl + X to boot Type in passwd username to set password. I could not do this because the print on the Edit screen was too small and blurred to find the Linux line.

Using Ubuntu 13.04 and just trying to clean everything up on my PC to install the latest version of Ubuntu.

linuxteen 02-10-2016 07:16 PM

Have to tried the chroot method? That's where you use a linux liveDVD andd then mount the root partition of your distro. You will then run:

mkdir /mnt/root
mount /dev/sdXX /mnt/root # your_ubuntu_root_partition
chroot /mnt/root

then run:

passwd

exit

reboot

BW-userx 02-10-2016 08:20 PM

Quote:

Originally Posted by arranskye (Post 5498335)
Sorry, I know there are several posts in general and in various forums relating to re-setting forgotten passwords. I have re-set passwords myself and kept written instructions to use but this time nothing appears to work.

Using Ubuntu 13.04 and just trying to clean everything up on my PC to install the latest version of Ubuntu.


STEP by STEP details

Quote:

Unlock The Root Account, Reset The Root Password, Change Username In Ubuntu 13.04 Raring Ringtail

the sudo password should be the root passwd, but with these crazy distros that veaar away from a (old school) Linux that uses root as a user too well ....

Emerson 02-10-2016 08:25 PM

Something is fishy here, forgotten sudo password? There is no such thing, user password is used for sudo.

BW-userx 02-10-2016 08:49 PM

Quote:

Originally Posted by Emerson (Post 5498367)
Something is fishy here, forgotten sudo password? There is no such thing, user password is used for sudo.

I just set my sudo to nopasswd ;) so no worries ;)

arranskye 02-11-2016 12:43 PM

Thank you for your replies. I call my username sudo because I always think of it as the sudo password as the terminal asks for sudo password. Nothing fishy It distinguishes it more easily in my mind from the root PW.

Managed to sort it so will put it here in case it helps others. grub e to edit arrow down and type single after ro on the line that starts linux /boot/vmlinuz. F10 to boot dropped into a root prompt. Type passwd username worked fine.

Thank you are again.

linuxteen 02-11-2016 01:59 PM

glad you have solved it.

Blitzig 02-15-2016 09:43 AM

Hi,

You can try the below and see if it works.


> Boot and in GRUB highlight the kernel you wish to boot and press "e" to edit the kernel.

> Look for the string "rhgb quiet"

> Change the string to "init=/bin/bash"

> Press Ctrl+x to boot into the system with runlevel 1

> Mount root as RW

$mount -o remount,rw /

$passwd root
This will prompt to enter a new password for root.

or

$passwd user_name
This will prompt to enter a new password for the specified user

$touch /.autorelabel

$exec /sbin/init
This command will reboot the system


All times are GMT -5. The time now is 02:51 PM.