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.
You can't do that using the GUI tool, but you can using the terminal.
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, replacingdavid
with your username:Close the editor to apply the changes, and test the effect on sudo in a new terminal.
Delete the password for your user by running this command:
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 withpkexec
(thanks muru).Warning: Be careful once you remove your password using this method, you won't be able to authenticate yourself to prove you have admin rights, in a GUI or in the terminal (like installing an application using Synaptic, or using
sudo
through the command-line). This is because of bug #1168749.Only do this if the user is not the only admin user.
This has been tested on Ubuntu 12.04 and 12.10.
Make sure that you click on Unlock to be able to accomplish the tasks below:
Go into user accounts, and click on the password field:
Once the window opens, click on the down arrow to the right of "Action"...
and change it to "Log in without a password", and then click on "Change":
Optionally, you can also enable automatic log-in, like this:
To give the user a password again after running this procedure, you can't use a GUI (bug #882255), you have to use the command-line:
Log in as another user with admin priveleges. (Remember, the original one cannot run with admin privileges without a password using this method.)
Run the following in a terminal:
Again, I must warn you that once you remove the password, you won't be able to authenticate yourself in the GUI or a terminal, like installing an application using Synaptic, or using
sudo
on the command-line.I think it's possible to do this, but will get you into trouble once you try to install updates or anything else that requires sudo; as you need an account with sudo access (and a password) in order to install.
Your best options seem to be:
gksu gedit nano -B /etc/shadow
then find the new user and change the existing password hash with:U6aMy0wojraho
-- so it looks something like:newuser:U6aMy0wojraho:13996:0:99999:7:::
Best solution to your question: Choose to automatically log in your account, which is likely the main benefit you're after. to do this:
press CTRL-ALT-T (to open terminal). In Terminal, type:
add the lines:
replace
YOURUSERNAME
-- with an actual username on your system.Looks like, an empty password doesnt match Password Complexity requirements.
This is what I found in
man passwd
EDIT: Unfortunately, you can't set the password to empty through that UI.
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/quantal/gnome-control-center/quantal-proposed/view/head:/panels/user-accounts/um-password-dialog.c#L358
is the function which decides whether to enable the "Change" button or not.
The minimum password len 6 is hardcoded :(
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/quantal/gnome-control-center/quantal-proposed/view/head:/panels/user-accounts/um-password-dialog.c#L39
Its a GUI interface and that is what is preventing you from making it a blank password.
If there was a way it would have to be done via terminal.
But, in the end you have to enter the system via the GUI and even if you did change the password to blank the GUI would prevent that. So unless you want to change to a non GUI interface it is simply not possible.
It is possible to change password after deletion. You need just to boot in recovery mode. Here you'll find a nice tutorial: http://www.psychocats.net/ubuntu/resetpassword
In short what you'll find on the link above:
In boot-up menu select "Drop to root shell prompt" option
type on console one by one
then reboot normal