Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I install the Ubuntu, I set a short password(<4). Now I want to change the other short password by "passwd" or change passphrase on "Password and Keys" program, it needs a password >4 char.

share|improve this question
Why do u want to set a short password? That is not safe, try you change the password from root account even if you forced to do. – karthick87 Aug 25 '12 at 18:48
@karthick87 because my home computer is not Fort Knox. If strangers are messing with my desktop then I have bigger concerns than my computer. – Torben Gundtofte-Bruun Sep 18 '13 at 18:24
@karthick87 Why a short password? Ubuntu might run as a virtual machine and your virtualization software lacks copy and paste functionality for the command line of Linux guests (like Parallels desktop for Mac 8.0 does miss), then you want to access Ubuntu with a short password, or even better without a password at all. – Pro Backup Feb 12 '14 at 10:08

Use following command in Terminal:

sudo passwd <user>

Replace <user> with the username whose password you wish to change.

This works because passwd suppresses all checks for length or entropy when you use it as the root user.

Warning: if the target user has an encrypted home directory, this will cause problems! (see comments below)

share|improve this answer
This does not work. It does not provide the information required. – NlightNFotis Aug 25 '12 at 19:17
It does work. If you are root it will not force you to fallow the password strength requirements. – user72421 Aug 25 '12 at 19:56
This works fine for me. I'm able to set a user's password to a using this method, on an Ubuntu 12.04 LTS system. – Eliah Kagan Sep 8 '12 at 1:35
This will cause problems when you have an encrypted home directory, as it breaks the automatic decryption of the ecryptfs passphrase. – guntbert Jan 16 '14 at 22:37
@guntbert is right: Forcing the password this way the user won't be able to login again if his/her home directory is encrypted, so this is not the right solution in these cases. – fuenfundachtzig Aug 28 '14 at 8:55

By default, Ubuntu requires a minimum password length of 6 characters, as well as some basic entropy checks. These values are controlled in the file /etc/pam.d/common-password, which is outlined below.

password        [success=2 default=ignore] obscure sha512

If you would like to adjust the minimum length to 4 characters, add the appropriate variable (minlen=4) to the end of the line. The modification is outlined below.

password        [success=2 default=ignore] obscure sha512 minlen=4


share|improve this answer
I couldn't get min= to work and it doesn't match the man page, despite the Wiki page. Seems to be minlen= – John S Gruber Aug 25 '12 at 19:42
Thank you for the info. =) – NlightNFotis Aug 25 '12 at 19:43
remove "obscure" for also disable complexity check – Pisu Jul 3 '13 at 8:38
sudo passwd user seems more useful – gyozo kudor Mar 3 '14 at 14:50

Bring up a terminal and edit /etc/pam.d/common-password

Change this line:

password    [success=1 default=ignore] obscure sha512


password    [success=1 default=ignore] obscure sha512 minlen=4

Password also need a certain amount of complexity, as specified by the obscure parameter above.

password    [success=1 default=ignore] minlen=2 sha512

removes that check also.

This all presupposes that you think this is wise.

See man pam_unix

These work on my system.

share|improve this answer
this works for ubuntu12.04 – David May 23 '13 at 14:37
valid for 13.04 too – Torben Gundtofte-Bruun Sep 18 '13 at 18:33
valid for 15.10 (Wily), too. – kmonsoor yesterday

To change password use su command in terminal.

After su use passwd username to change password.

The password can be of short length. This works in Linux Mint.

share|improve this answer
Incorrect; this is almost equivalent to the top voted answer (currently with 46 votes) but by omitting the user name after the passwd command, you end up changing the root password instead of the user's password. – Wildcard Oct 10 '15 at 8:48
Thanks @Wildcard for pointing out the mistake, answer updated. – Thor Odinson Oct 13 '15 at 8:23

To set up a simple password, I tried the simple sudo passwd username method, but it failed on my Ubuntu Server 12.04 LTS.

So I tried to remove the obscure option from /etc/pam.d/common-passwd config file, but it still failed.

So I also removed the obscure option from /usr/share/pam-configs/unix config file. And then it worked :-)

I do agree that it should be simplier, when acting as su to set up a weak password, whatever the reason why one wants to do it! A warning saying "weak password, confirm?" would be perfect...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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