# 4 Easy Ways To Generate A Strong Password In Linux
![Generate a strong password in Linux](https://www.ostechnix.com/wp-content/uploads/2016/11/password-720x340.jpg)
Image Courtesy: Google.
Yesterday, We have covered how to[force users to use a strong password in DEB based systems][8]such as Debian, Ubuntu, Linux Mint, Elementary OS etc. You might wonder how a strong password looks like, and how could I create one? No worries! Here is the 4 easy ways to generate a strong password in Linux. Of course, there are many free tools and ways to accomplish this task, however I consider these methods are simple, and straightforward. Let us get started.
Download–[Free EBook: “Getting started with Ubuntu 16.04”][7]
### 1\. Generate a strong password in Linux using OpenSSL
OpenSSLis available for all Unix-like distributions, Solaris, Mac OS X, and Windows.
To generate a random password with OpenSSL, fire up your Terminal and run the following command:
```
openssl rand 14 -base64
```
Here,‘-base64’string will make sure the password can be typed on a keyboard.
The above command will generate a random and strong password with length of 14 characters. Remember It is always recommend to generate 14 characters password. Of course you can generate any length of characters using openssl.
For more details, refer the man pages.
```
man openssl
```
### 2\. Generate a strong password in Linux using Pwgen
pwgenis simple, yet useful command line utility to generate a random and strong password in seconds. It designs secure passwords that can be easily memorized by humans.It is available in the most Unix-like operating systems.
To install pwgen in DEB based systems, run:
```
sudo apt-get install pwgen
```
In RPM based systems:
```
sudo yum install pwgen
```
In Arch based systems:
```
sudo pacman -S pwgen
```
Once pwgen installed, generate a random and strong password with length of 14 letters using command:
There are also some useful options available to use with pwgen command.
```
-c or --capitalize (Include at least one capital letter in the password)
-A or --no-capitalize (Don't include capital letters in the password)
-n or --numerals (Include at least one number in the password)
-0 or --no-numerals (Don't include numbers in the password)
-y or --symbols (Include at least one special symbol in the password)
-s or --secure (Generate completely random passwords)
-B or --ambiguous (Don't include ambiguous characters in the password)
-h or --help (Print a help message)
-H or --sha1=path/to/file[#seed] (Use sha1 hash of given file as a (not so) random generator)
-C (Print the generated passwords in columns)
-1 (Don't print the generated passwords in columns)
-v or --no-vowels (Do not use any vowels so as to avoid accidental nasty words)
```
For more details, check the man pages.
```
man pwgen
```
### 3\. Generate a strong password in Linux using GPG
GPG (GnuPG or GNU Privacy Guard), is free command-line program and replacement of Symantec’s PGP cryptographic software. It is available for Unix-like operating systems, Microsoft Windows and Android versions.
To generate a random and strong password with length of 14 characters using GPG, run the following command from the Terminal:
Note:I couldn’t find the original author of this script. If anyone know the author’s name, please let me know in the comment section below. I will add the author name in this guide.
Please note that you must memorize or keep the passwords you have generated in a safe place in your computer. I recommend you to memorize the password and delete it from your system. It is much better in case your system is compromised by any hackers.
That’s all for today folks. I will here with another interesting article soon. Until then, stay tuned with OSTechNix.