Skip to content

How to generate secure passwords using terminal (Mac/Linux) ?

Published: at 09:30 AM

Passwords protect you from unauthorized access to your computer 💻, application, and other personal information (credit card info, ssn no, etc). The stronger your passwords, the more secured you are.

In today’s date, with everything online, it has become important to secure yourself with stronger passwords to protect yourself from hackers with wrong intent, and malicious software.

It is always advised to create a password with letters, numbers, and special characters as they are pretty difficult to crack. A wide variety of sites provide you with an online tool to generate secure password.

pw-image The biggest concern with online password generator is you are never sure whether the company of the password generator will know your new password or not. How will you know if the password generator’s site has been compromised or not? The password you may have generated from a site might have been compromised and decoded in another place.

There are different password manager applications like LastPass, Dashlane, etc that generates secure password that are safe to use. If you are a MacOS or a Linux, it is easy very easy to generate safe and secure passwords.

PWGEN pwgen is a small package available for both MacOS and Linux that helps you generate secure and strong passwords in no time. The installation and usage is very easy.

Installation For MacOS users, you can simply install using the Homebrew package manager.

brew install pwgen

For Debian/Ubuntu,

apt-get install -y pwgen

For CentOS,

yum install -y pwgen

Usage pwgen is easy to use. Simply, type in pwgen on your terminal and it will generate a list of passwords. generate-pw

> pwgen -s -1 12

The above command will generate single secure password with 12 characters. If you want to add a special character to your password:

> pwgen -s 10 4 -1 -y

The above command will generate 4 secured passwords with 10 characters with at least 1 special character. sp-pw

> pwgen -s 20 -1 -v -c -0

This above command will generate a single password with 20 characters with 0 vowels and numbers with at least 1 single letter in caps.

pwgen is easy to use and is efficient to generate random secure password. You will be easily able to define the password length, characters and symbols. Install this handy utility and make yourself secured 😈🥷🏻