How to generate random passwords from the Linux command line
Published on: 2025-07-04 23:25:57
ZDNET
I often need random passwords. Mostly, those passwords are used for the creation of user accounts on apps and services, at which point I'll use my password manager that includes a very good random password generator.
But other times, I might need a temporary password that doesn't require saving in a password manager. Or maybe it's a permanent password, but I'm logged into my desktop from a remote machine, and the command line is the only tool I have.
Also: 5 Linux commands I use to keep my device running smoothly
Regardless of why, there's a simple Linux command that makes it very easy to generate random passwords. That tool is called pwgen, and here's how you install and use it.
How to install pwgen
What you'll need: The only things you'll need for this are a Linux distribution and a user with sudo privileges.
1. Install pwgen on Debian or Ubuntu-based distributions To install pwgen on Debian or Ubuntu-based distributions, open a terminal window and issue the command: Sho
... Read full article.