Created
March 18, 2021 07:58
-
-
Save jairajsahgal/2a55797e3766235be254f507ff64df9b to your computer and use it in GitHub Desktop.
Password Generator in Bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple password generator | |
echo "This is a simple password generator" | |
echo "Please enter the length of the password" | |
read PASS_LENGTH | |
echo "Please enter number of passwords to be generated" | |
read NO_OF_PASS | |
echo "Enter website for which password is to be generated" | |
read COMPANY | |
touch "$COMPANY.txt" | |
for p in $(seq 1 $NO_OF_PASS); do | |
temp=`openssl rand -base64 48 | cut -c1-$PASS_LENGTH` | |
echo $temp>>"$COMPANY.txt" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It generates passwords according to the user password length, and number of passwords to be generated.
It also stores those passwords in the specified website text file.