2013
04.28
04.28
so i added two different password generator functions into my .zshrc.
one for regular:
function genpasswd() {
if [ -z $1 ]; then
echo "need a character count"
else
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${1} | xargs
fi
}
and one for strong:
function genpasswd_strong() {
if [ -z $1 ]; then
echo "need a character count"
else
tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?=' < /dev/urandom | head -c ${1} | xargs
fi
}
using them:
% genpasswd 12
Z14QsnEPKvOt
% genpasswd_strong 12
3%^d!Ze}-$_@
simple enough.
here is a link to my .zshrc.
The following two tabs change content below.
charlie root
VP of keeping it real / HNIC at pissedoffadmins.com
I bring the cold coffee.
Latest posts by charlie root (see all)
- AWS MFA cli script - September 14, 2018
- ssh tunneling with .{bash,zsh}rc functions - August 13, 2018
- ssh master just for the ports - March 29, 2018
Does `pwgen 10 -N5` work?
not pre-installed in some of the distro’s i use. method i use does not need external addons or deps.