Bash scripting 22 – passwords

Having a secure password is really important, but thinking of one can be difficult, you can use three random words such as

CanBookBoard2024%

I have added some numbers and a special symbol here as some websites will insist on more than just upper and lower case letters.

Tbankfully bash has a tool for this

apg - generates several random passwords

You can find more information in the man page

man apg

The example below

apg -m 15 -M SNC

which produces

thuhuHersyoywik2
SindEjpiTrildaf3
Biabodke0skyudha
JeKneapFelu5gDom
neHydishGijcis02
NefNan2JeymDabas

So looking at this

-m 15 – tells apg min password length should be 15 characters -M SNC

Forces apg to use (you need SNC in capitals to force this) * special symbols e.g: %^&* * numerical characters, e.g 1234 * capital letters

Using -M SNC will give the same result.

To change the password on a GNU/Linux system use

passwd

Tags

#Bash,#Bashscripting,#BashScripting#apg,#Security,#Password,#Generation


Mastodon ShellLabs Join Mastodon
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.

Donate using Liberapay