Copy and paste the following code at the end of /root/.bashrc file
- Code: Select all
genpasswd() {
local l=$1
[ "$l" == "" ] && l=20
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}
Then type,
- Code: Select all
genpasswd 12
Output:
zzCKSosOXTEK
You will get the 12 character password in mixed style.
Cool
