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,949

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,762
1

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

Fahad Sadah
  • 1,546