Generate password

in case you need a quick way to generate a password length 8

openssl rand -base64 8

8 Likes

I usually use pwgen (old ref article):

image

sudo apt install pwgen
sudo dnf install pwgen
sudo pacman -S pwgen

Edit: Found project page: Password generator CLI

7 Likes

nice. I made an alias, alias p='openssh rand -base64 8' when I type p, I get a random 8 char pw, quick n dirty. There are plenty of one-liners. It’s good to share with the group.

5 Likes

Old discussion featuring some cli tools and approaches is here: https://askubuntu.com/questions/976808/password-generator-combining-actual-words Hopefully, you find it interesting.

5 Likes

Hi, everyone :slight_smile:

I guess that another way to generate (somewhat “random”) passwords is to use the uuidgen command that generates an UUID (“Universally Unique Identifier”) and that I think comes pre-installed in most Linux distributions:

$ uuidgen
11508465-9363-4ee1-b6d8-1091aa963a3a

$ uuidgen
32839d19-bd14-4aa1-8124-c0d56d9ee1ee

$ uuidgen
06a57e39-8e0a-4af9-a0ba-e4159df14871

Granted, this is NOT completely random, since it follows a specific format, namely that it is a string of 32 hexadecimal characters (comprised of only lowercase ASCII letters, digits and hyphens) and that has a specific “grouping” of characters. You may find a more detailed description and explanation of the UUID format and the uuidgen command, for instance, in the following article:

4 Likes

I tend to use passphrases for anything important. That way I can remember them. I don’t store passwords, except on an encrypted USB drive.

https://www.techrepublic.com/article/what-is-passphrase/

Passphrase examples

When creating your password, consider capitalizing random letters within the phrase and replacing letters with symbols. For example, “@” for “a.”

ILoveiCeCre@msoMuch!
Jack&JillWentUptheHill
Mich@elJ@cksonIstheGr8testofAllTime

I do something like: MydAwdgcostmebig$whenheate8oysters! (not a real passphrase)

Bitwarden password Checker:
Your password strength strong
Estimated time to crack : centuries

security org password checker:
It would take a computer about
1 trestrigintillion years
to crack your password

5 Likes

Great! Thank you for highlighting the fact that ‘universally unique’ is not necessarily ‘random’. But let me to mention that version 4 of formal UUID specification dictates 122 random bits within UUID format. Next to it, AFAIK, hexadecimal representation of UUIDs with hyphens is a legacy of version 1 fields structure and does not always reflects UUID actual format.

5 Likes

Wow! I did not know that ! Good info ! :+1:

3 Likes

How about “Standard” Linux Way: you can pull bits directly from the kernel’s random number generator and filter them:

tr -dc A-Za-z0-9 </dev/urandom | head -c 8; echo

5 Likes

@Blue_bird

I consider your solution as the 100% UNIX-spirited construct … very elegant :+1:

4 Likes