Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Password Generator in Bash
#!/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
@jairajsahgal
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment