1

Is there a command that will let me change all the user passwords at once? I would like to find an easier way to perform this change for all 32 users on my machine, and doing them one at a time is not efficient. I don't mind about changing root, I just want to change passwords for all accounts, admins and basics.

Thank you for your help.

Ubuntu 16.04

1

You can use the chpasswd command. This command can only be used as root. Enter the chpasswd command into the command line then enter the name of the user followed by the password, do this for each user. When finished type ctrl+d. ex.

your-computer ~ # chpasswd
user1: password
user2: password
user3: password

Another way that you can do this is to have a file containing all of the usernames and passwords, int he same format ie. user1: password. create this file using any text editor such as vim or cat. Example on creating the file.

your-computer ~ # cat > bulkpasswords
user1: password
user2: password
user3: password

Then run the chpasswd command(as root) on the file:

your-computer ~ # chpasswd < bulkpasswords

Hope this helps!

Sources: https://linoxide.com/linux-command/change-passwords-batch-mode-chpasswd/

  • it does help, but im still trying to find a command that will let me change all the passwords with one command, like "sudo passwd {list of users} Password" that way I dont have to type out every users name. – JJ Ubuntu Oct 16 '18 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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