[Linux] Random password generator

[Linux] Random password generator

Here is a script for generating random alphanumeric passwords:

#!/bin/bash 
# passwords.sh  
if [ $# != 2 ]; then
	echo "usage: $0 <length of passwords> <number of passwords> "
	exit 1
fi
tr -cd '[:graph:]' < /dev/urandom | fold -w $1 | head -$2

Leave a Reply

Your email address will not be published.