1

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.

pehrs
  • 8,749
  • 29
  • 46

2 Answers2

3

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
Jure1873
  • 3,692
  • 1
  • 21
  • 28
1

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

Fahad Sadah
  • 1,496
  • 11
  • 21
  • 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 05 '10 at 16:51
  • You need to enable the Universe repository first. See instructions at https://help.ubuntu.com/community/Repositories/CommandLine#Adding the Universe and Multiverse Repositories – Fahad Sadah Nov 05 '10 at 16:55
  • Still no luck with Universe and Multiverse enabled. – pehrs Nov 05 '10 at 17:28
  • Did you type `sudo aptitude update` after enabling? – Fahad Sadah Nov 05 '10 at 17:40