I just installed Ubuntu 15.10 on my new desktop. However, I want to erase the password of it. I followed the instructions here. I now can successfully login with out password, but I cannot use sudo command. It prompt me to enter my password. I tried both empty and the old one. Neither of them will work. How to solve that problem?

  • what you get when you enter any command preceding with sudo ?
    – Rahul
    May 5, 2016 at 7:50
  • [sudo] password for [myusername]:
    – Trams
    May 5, 2016 at 8:14
  • I mean after you enter [sudo] password for [myusername], what error message you get ?
    – Rahul
    May 5, 2016 at 8:24
  • Sorry try again
    – Trams
    May 5, 2016 at 8:33
  • That is actually a very good protection. You do realize that removing that protection would remove any kind of protection from your system, right? May 5, 2016 at 8:36

1 Answer 1


Disclaimer: IMHO, this is a very bad idea. You should not erase the password of an account.

As explained here, you have to disable the password check in sudo, editing the sudo configuration file.

Note that the order is important. You have to change sudo configuration before to erase the password. If it is to late, you can simply set a new password, change the configuration and delete the password again.

  • Yeah, like you said, I first did sudo visudo and add [myusername] ALL=(ALL) NOPASSWD:ALL in the file; next, I ran sudo passwd [myusername] -d to delete the password. After that I can actually login my account without password. However, in that circumstances, I cannot use sudo command, like I put it in the question.
    – Trams
    May 5, 2016 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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