51

Here are my circumstances:

  • I am running Ubuntu 12.04.
  • I have one user account.

I absolutely hate the password requirement. How do I disable this requirement such that my Linux computer will behave more like Windows in this respect? I do not want to hear that I shouldn't this because it is not secure. This is my desire so the concern of security is effectively null and void.

Melab
  • 1,678
  • 8
    Which password requirement? Your user's password or the administrative password? Also what do you mean with "more like Windows?" My windows machine has similar behavior to Ubuntu so if you could clarify that would be great! – Jorge Castro Jan 02 '13 at 01:12
  • What do you mean? There's an option to login automatically. If you mean the password to do administrative tasks, there's probably ways around it but would not make sense to do it. You do not need to enter the password that often at all. – marcusklaas Jan 02 '13 at 01:14
  • the below answer doesn't work for me on Ubuntu16. But this one works: https://askubuntu.com/questions/147241/execute-sudo-without-password – 1rq3fea324wre Oct 04 '17 at 17:12

1 Answers1

70

For the administrative password using sudo and sparing any lectures on why one would not want this...

Edit the sudoers file:

sudo visudo

Find this line:

%sudo ALL=(ALL) ALL

Change the line:

%sudo ALL=(ALL) NOPASSWD: ALL

Save and Exit. Voila! (Dont' shoot yourself in the foot, now. ;)

By the way, you can become root and just type the password once.

sudo su -

Now you ARE the root user, seeing no more password prompts. When you see guides referring to commands such as sudo some_command, just remove the "sudo" portion. In this way, you can choose to leave the security intact yet bypass it as you see fit.

If you are writing about your user account:

Open System Settings. Click on the User Accounts tile. Click the Unlock button and enter your password. Set the auto-login slider to the "on" position by dragging it to the right. Then click "Lock" to apply your changes.

  • Is there any way to do it without selecting auto-login? I've heard something about a blank password hash, though that would probably still require a password prompt. And can this be done without becoming the root user? – Melab Jan 02 '13 at 03:18
  • @Melab One part is for admin access; one, for regular user acct. No, you cannot do the sudo part without having admin access. –  Jan 02 '13 at 20:45
  • 1
    +1 for the sudo su - tip. – radj Feb 27 '14 at 09:32
  • 1
    How do we do this without vi? I can't use vi for the life of me. – mpen Aug 07 '14 at 16:43
  • 1
    Mark -- try installing 'nano'. It's a modeless text editor, which makes it a lot easier to use if you're unfamiliar. vi/vim has a steep learning curve. – Rick Chatham Sep 18 '14 at 21:20
  • yaaay crashed my sudo. unable to recover it since I even can't sudo su -. Great – Brettetete Jan 29 '15 at 19:38
  • @Brettete You can recover by mounting your drive in a live cd, and then copying over the live CD's /etc/sudoers to the botched system. BTW, visudo protects your sudoers file by refusing to overwrite the existing config when the new version has syntax errors. Now, semantic errors can still lock you out of the system, but it protects from simple mistakes. – jpaugh Aug 31 '17 at 18:20
  • This doesn't work for me on Ubuntu16. But this one works, https://askubuntu.com/questions/147241/execute-sudo-without-password – 1rq3fea324wre Oct 04 '17 at 17:12