User Tools

Site Tools


generate_good_password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
generate_good_password [2009/10/09 22:49] k2patelgenerate_good_password [2020/08/10 02:35] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Generate good password ====== ====== Generate good password ======
 +how simple it is 
 +<code bash>
 +echo `< /dev/urandom tr -dc A-Za-z0-9 | head -c 10`
 +</code>
 +
 +Read further for complicated edition.
 +
 Usage : apg.sh 10  (generate 10 character password) Usage : apg.sh 10  (generate 10 character password)
 <code bash | apg.sh> <code bash | apg.sh>
Line 7: Line 14:
 else else
 for ((n=0;n<10;n++)); do dd if=/dev/urandom count=1 2> /dev/null | /usr/bin/gmime-uuencode -m -| sed -ne 2p | cut -c-$1; done for ((n=0;n<10;n++)); do dd if=/dev/urandom count=1 2> /dev/null | /usr/bin/gmime-uuencode -m -| sed -ne 2p | cut -c-$1; done
 +fi
 +</code>
 +
 +<code bash | apg >
 +#!/bin/bash
 +if [ $# -gt 2 ]; then
 +echo "Usage : $0 [<Number Of Password>] [<Lenght Of Password>]"
 +else
 +if [ $1 ]; then
 +        itr=$1
 +else
 + itr='10'
 +fi
 +if [ $2 ]; then
 + len=$2
 +else
 +        len='15'
 +fi
 +for ((n=0;n<$itr;n++)); do dd if=/dev/urandom count=1 2> /dev/null | /usr/bin/gmimeuuencode -m -| sed -ne 2p | cut -c-$len; done
 fi fi
 </code> </code>
generate_good_password.1255128543.txt.gz · Last modified: 2020/08/10 02:30 (external edit)