I forgot my sudo password

0

I forgot my sudo password. I want to install a package and it needs me my sudo password. Every time I enter the password by chance. I get the error of try again. Would you please tell me how I can recover it or if I can change it in terminal Thanks a lot

Farshad

Posted 2018-08-12T05:57:10.583

Reputation: 11

1It's the same as your login – DrMoishe Pippik – 2018-08-12T06:08:20.990

Actually, I forgot my root password. I don;t think its the same as my login – Farshad – 2018-08-12T06:29:34.873

This answer from our sister site will work. – n8te – 2018-08-12T07:38:55.307

Answers

1

From the official Ubuntu LostPassword documentation:

Reboot your computer.
Hold Shift during boot to start GRUB menu.
Highlight your image and press E to edit.
Find the line starting with "linux" and append rw init=/bin/bash at the end of that line.
Press Ctrl + X to boot.
Type in passwd username.
Set your password.

Fiendish Ferret

Posted 2018-08-12T05:57:10.583

Reputation: 11

Thank you very much. Actually, I have access to terminal only. Would you please tell me how I can do this using only terminal. – Farshad – 2018-08-12T08:01:25.833

1@Farshad This answer is for terminal mode. – Nordlys Jeger – 2018-08-12T18:36:13.657

The problem is when I want to reboot my system, it wants me to insert the root password and I forgot the root password. That means I can not reboot my system using terminal – Farshad – 2018-08-12T19:46:20.290