I disabled password for login at User Account setting, and later when I ran sudo, I get "Sorry, try again." It seems my previous password doesn't work anymore. I also tried hitting enter directly but it didn't work either.

I attempted to change the root password by following this article: https://linuxconfig.org/how-to-reset-lost-root-password-on-ubuntu-16-04-xenial-xerus-linux. Everything works fine, I did have got the "update password successfully" message. However, when I get back to the graphic desktop and tried to sudo anything, the new password didn't get me any more luck.

I repeated the process three more times and made sure there is no typo in setting new password. I also tried to remove sudo requirement by following this article: https://www.cyberciti.biz/faq/linux-unix-running-sudo-command-without-a-password/ after resetting password in grub mode, but that didn't help.

So right now the OS works fine but I can't do sudo anymore or authenticate anything at all. Any help will be appreciated!

So appearantly sudo asks for the user's instead of the root password, I guess that's while changing root password doesn't help. (Please correct me if that's not exact). However, I still can't find anything to get sudo to work after trying every single password I ever set up..

  • @KamilMaciorowski So according to that post sudo is asking for the user's password, not the root's password? Then how can I get sudo to work anyway.... Besides, I can't even authenticate in user account setting with either my previous password or my newly set root password.. – alclol Apr 21 '19 at 22:00
  • Have you tried with the password of the non-root-user? – ctrl-alt-delor Apr 21 '19 at 22:01
  • @ctrl-alt-delor What is that tho? I tried every single password I ever set up anywhere and none of them works. How can I retrieve or reset a functional password to get sudo to work? – alclol Apr 21 '19 at 22:03
  • If you disabled password checking for your account, you might need to re-enable it to be able to use sudo.  Or configure sudo not to ask for a password.  Or, if you dare, use su instead. – G-Man Says 'Reinstate Monica' Apr 21 '19 at 23:58

As @KamilMaciorowski and @ctrl-alt-delor suggested, the sudo command asks for user password, not the root password. Therefore, I tried to do passwd [MyAccount] from the Grub's menu and the problem is solved.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.