If your Ubuntu machine is at home, you may want log-in Ubuntu without a password in the Log-in Screen or run sudo command without asking for a password.
1.) Set your user account to log-in without a password.
This is easy, just click on top-right your user name and launch
System Settings -> User Accounts. Click Unlock and enter the password. Now, double click on pass-phrase after Password and you’ll see following pic.
Choose “Login without a password” in first drop-down box and click “Change” at bottom.
Now, you can log-in this user without password both in GUI log-in screen and text (tty1~tty6) mode. The password is actually set to “None”. So in the tty1~tty6 (press Ctrl+Alt+F1~F6), it won’t ask a password for running commands with
sudo at beginning. But in desktop environment,
sudo command and “Authentication Required” window still need password and you can’t get through whatever you input. To deal with that see following steps.
2.) Reset password in command-line. After that, you can login without password in LightDM Login Screen and all others back to normal.
Press Ctrl+Alt+F1 to navigate to TTY1 and log-in with your username. Then run this command to reset password:
sudo passwd YOUR-USER-NAME
Then input a new password and again to confirm.
3.) If you want executing
sudo command without asking for a password in terminal, run:
Under “# Members of the admin group may gain root privileges” change:
%admin ALL=(ALL) ALL
%admin ALL=(ALL) NOPASSWD:NOPASSWD:ALL
Press Ctrl+X and then input y to save it.