Memorable but secure passwords
Command Line – Password Generators
CLI tools for generating passwords have many options that can help you strike a balance between ease of use and security.
How should you generate passwords? You probably know the standard advice of using a variety of characters, but the resulting passwords are hard to remember, especially since the recommended length keeps getting longer as cracking methods become more sophisticated. It's enough to make users choose convenience over security and use the same password everywhere – which is just about the worst thing you can do. Yet even if you choose unique passwords in every circumstance, how random can passwords invented by one person truly be? And what strategies can you use to make random passwords memorable? A password manager can ease the daily burden, but what happens if your password manager becomes corrupted? What were simple issues a couple of decades ago have become complicated today, with no easy answers.
Ask security experts, and the answers to these questions can be conflicting. However, that doesn't stop the developers of password generators illustrating possible solutions. Many implement traditional answers, but others are starting to implement ways of making passwords more memorable, either by tweaking tradition in various ways or taking a new approach altogether.
PWGen
PWGen is one of the oldest password generators for Linux [1]. It is based on the traditional password advice, providing eight character strings for passwords that include lower- and uppercase letters, numerals, and special characters. This pattern can be modified by the options in Table 1 to produce an easier to remember password, but remember that excluding types of characters will probably result in a weaker password. For maximum security, specify --secure
(-s
), which will maximize the mixture of characters (Figure 1).
Table 1
PWGen Customization Options
--no-numerals (-0) |
Exclude numbers |
--no-capitalize (-A) |
Exclude uppercase letters |
--ambiguous (-B) |
Exclude confusing characters, like upper case O and zero (0). |
--capitalize (-c) |
Include at least one capital |
--numerals (-n) |
Include at least one number |
--no-vowels (-v) |
Exclude vowels and numbers that could be mistaken for vowels like 1 or 0 |
--symbols (-y) |
Include at least one special character |
Results are displayed in columns by default. However, you can use --lines
(-l
) to display results one per line. You can also control the number of results with --num-passwords=NUMBER
(-N
).
PWGen provides a wealth of options, but notice that its passwords are eight characters long. That used to be an adequate length and still provides moderate security. However, using traditional password standards, an increasing number of experts suggest a minimum of 12 characters. If the password you are generating is important to you, you might want to use another password generator.
pwmake
pwmake
is a simple utility available in the libpwquality-tools package [2]. It includes only one option: the amount of entropy bits used to generate the password (Figure 2). The minimum number of bits is 56. The man page suggests 64 bits when attackers do not have direct access to the password hash file, or 80-128 bits when attackers might have access or the password is used as an encryption key. However the number of bits can go even higher, if desired. The entropy is generated by /dev/urandom
. After generating the password, you can use pwscore
or pam_pwquality
, two other utilities in libpwquality-tools, to check the strength of the generated password. Since the passwords are random and long, you will probably only want to use pwmake
with a password manager.
gpw
gpw
[3] is another simple password generator. It uses two options: the number of passwords generated, and the length of each password. Unlike pwmake
, gpw
generates passwords that are easy to pronounce for English speakers and should therefore be easy to remember. The price for easier to remember passwords, of course, is less security (Figure 3).
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.