Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I am converting some scripts from an ancient SuSe install, after a swap to ubuntu. These scripts uses a tool called mkpasswd, which sets user passwords. I wonder if there is something similar for Ubuntu so I don't have to code it myself. The tool is very simple. It reads a file like


And sets the passwords on the users.

share|improve this question
up vote 3 down vote accepted

chpasswd is very similar. Installed by default in ubuntu.

NAME chpasswd - update passwords in batch mode

SYNOPSIS chpasswd [options]

DESCRIPTION The chpasswd command reads a list of user name and password pairs from standard input and uses this information to update a group of existing users. Each line is of the format:

share|improve this answer
I just found it myself ;) But thanks, it is indeed the right command. – pehrs Nov 5 '10 at 17:46

Ubuntu has mkpasswd - you may need to install it by running sudo aptitude install mkpasswd.

share|improve this answer
Hmmm. "No candidate version found for mkpasswd" is what I get from that command. The only thing that seems to match is "libstring-mkpasswd-perl", and that does not seem to do what I want to do... – pehrs Nov 5 '10 at 16:51
You need to enable the Universe repository first. See instructions at the Universe and Multiverse Repositories – fahadsadah Nov 5 '10 at 16:55
Still no luck with Universe and Multiverse enabled. – pehrs Nov 5 '10 at 17:28
Did you type sudo aptitude update after enabling? – fahadsadah Nov 5 '10 at 17:40

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.