Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

username1:password2
username2:password2
....
usernameN:passwordN

And sets the passwords on the users.

share|improve this question

2 Answers 2

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:

   user_name:password
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 help.ubuntu.com/community/Repositories/CommandLine#Adding 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

 
discard

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.