Ubuntu – set the user account to have no password

passwordusers

If I attempt to change my password to nothing by opening "User Accounts", the "Change" button remains greyed out:

How do I change my password to be empty? I know you can set Ubuntu to automatically log you in, but I want my password to be empty, I never want to type in a password to authenticate myself as that user.

I know that there are reasons why this might not be a good idea, but I want to know if it is even possible. I'm using Ubuntu 12.10.

Best Answer

You can't do that using the GUI tool, but you can using the terminal.

  1. First, if your user has sudo privileges, you must enable its NOPASSWD option. Otherwise, sudo will ask for a password even when you don't have one, and won't accept an empty password.

    To do so, open the sudoers configuration file with sudo visudo, and add the following line to the file, replacing david with your username:

    david ALL=(ALL) NOPASSWD:ALL
    

    Close the editor to apply the changes, and test the effect on sudo in a new terminal.

  2. Delete the password for your user by running this command:

    sudo passwd -d `whoami`
    

If you ever get prompted for a password, just type enter and it should work. I've tested this answer with LightDM, the lock screen, sudo, gksu and it works, but there's one more step to get it to work with pkexec (thanks muru).