How to Easily Make Strong Random Passwords

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
MishaSherpa

How to Easily Make Strong Random Passwords

Post by MishaSherpa »

If you do online banking, or care about your email privacy, you really should be using strong passwords. Luckily, linux makes this very easy to do. Install the pwgen (password generator) via command line:

Code: Select all

sudo apt-get install pwgen
Here is how to make a four passwords to choose from, each being 18 letters in length:

Code: Select all

pwgen -s -y -1 18 4
Here is what that means:
-s means secure: generate completely random, hard-to-memorize passwords.
-y means please include symbols
-1 means please list them one line at a time
18 means the passwords should have length 18
4 mean: Please give four results to choose from

It can be fun and addicting to play with this program.

PWGEN has many cool features. You can see them via the manual. At the command line type:

Code: Select all

man pwgen
If you are uneasy letting a program decide passwords for you, then use pwgen, but then CHANGE a few letters to whatever to want. Thank you to Theodore Ts'o for this excellent program.
Habitual

Re: How to Easily Make Strong Random Passwords

Post by Habitual »

Code: Select all

date +%s | sha256sum | base64 | head -c 20 ; echo
date +%s | sha1sum | base64 | head -c 20 ; echo
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-20};echo;
CaptainMark

Re: How to Easily Make Strong Random Passwords

Post by CaptainMark »

apg is already installed that does exactly this
MishaSherpa

Re: How to Easily Make Strong Random Passwords

Post by MishaSherpa »

CaptainMark wrote:apg is already installed that does exactly this
Hi, on my distro APG is not installed by default.
PWGEN was written by Theodore Ts'o. He is a serious contributor to linux and /dev/random, so PWGEN would be my first choice. I tried to figure out who wrote and maintains APG, but got confused.

https://en.wikipedia.org/wiki/Theodore_Ts%27o

There has been some controvery is the news recently about chipmakers, hardware random numbers and security. Ts'o is very knowledgeble about all the issues. Again, if security is a concern, I would use pwgen and even change a few characters manually.

https://www.schneier.com/blog/archives/ ... ously.html

https://plus.google.com/117091380454742 ... Dcoemc9V3J

Most off the controvery is around generating weak keys for SSL on https and not knowing about it. That stuff is beyond the scope of a simple personal password generator, but you learn a lot as you read about the controversy.
Post Reply

Return to “Tutorials”