1

I forgot my root password and later reset it by modifying the grub boot loader script: "ro" to "rw init=/bin/bash". After that, "Ctrl+X" brought me to a root environment where I created my new root password.

This new password enables me to enter the root environment (# instead $) where I can do everything that requires "sudo". However, this password couldn't work when I try to do the command "sudo apt-get ...".

If the password used by "sudo" should be the user's password, how could I create a new one if I have already logged into the system? I simply forgot this password. I could log into the system because the system is set without a login required.

Thanks in advance!

4
  • root user password and your user password (when you do sudo apt .. you use your user not root user) are 2 different things. For sudo apt .. you use your regular user password (assuming that user is in sudoers group). Jan 2, 2021 at 14:02
  • I have logged into the system, but I forgot my user password
    – Ling
    Jan 2, 2021 at 14:15
  • If you are logged as root user you can change your regular users password with: passwd <YOUR USERNAME> Jan 2, 2021 at 14:26
  • 4
    Does this answer your question? How do I reset a lost administrative password?
    – mook765
    Jan 2, 2021 at 15:05

0

You must log in to answer this question.

Browse other questions tagged .