View Single Post
  #7   (View Single Post)  
Old 5th February 2010
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

A script using the jot(1) approach as described in the previous posts:
Code:
#!/bin/sh

TOTAL=300       # total wanted characters
LEN=15          # length of password
NR=$(echo "scale=2 ; ${TOTAL} / ${LEN}" | bc )

echo "$0: creating $NR passwords with  ${LEN} characters"
echo
jot -r -c  $TOTAL 33.01 126.99 | rs 0 ${LEN} | cat -n

cat <<END

To see the password without spaces please
copy the desired password with mouse and
press <ENTER> : 

END

read PASSW
echo "${PASSW}" | tr -d ' '

# -- end of file
The variables TOTAL and LEN allow easy customization.
Example of usage:

Code:
$ ./password-generator 

./password-generator: creating 20.00 passwords with  15 characters

     1  2  #  G  #  T  /  {  ]  V  ]  8  O  O  S  @
     2  6  5  V  e  w  K  )  =  &  |  ^  }  F  e  `
     3  \  2  U  3  G  ;  D  o  X  n  Q  /  f  .  4
     4  Q  ,  1  U  e  (  8  |  z  e  F  +  8  /  t
     5  0  >  )  x  S  2  -  <  `  X  y  [  {  _  P
     6  Z  Z  8  b  #  x  [  )  |  *  !  l  J  }  c
     7  x  f  A  O  D  y  E  .  =  r  U  D  q  z  k
     8  Y  Q  _  Z  T  H  M  m  :  ^  T  =  }  ~  t
     9  @  T  O  &  C  '  Y  z  ;  &  U  <  ?  w  i
    10  o  }  p  i  |  o  o  !  g  t  _  [  A  g  ^
    11  #  '  f  "  q  A  K  7  %  A  6  G  K  7  p
    12  O  U  t  +  P  ~  )  ~  @  '  q  L  ?  {  J
    13  7  Q  '  W  (  %  _  {  b  Z  z  D  f  $  s
    14  e  d  R  &  N  _  O  s  C  P  Z  Z  [  9  "
    15  P  J  {  v  N  3  /  a  b  {  F  k  Z  :  O
    16  4  g  ,  @  =  J  4  R  B  D  @  u  C  ^  :
    17  w  h  x  R  %  D  *  )  P  M  \  :  b  9  Q
    18  r  $  e  u  c  {  A  )  P  t  E  x  j  }  {
    19  8  !  )  I  b  +  q  +  i  8  j  5  8  L  ^
    20  "  g  V  r  '  8  8  Z  j  `  J  t  6  v  =

To see the password without spaces please
copy the desired password with mouse and
press <ENTER> : 

P  J  {  v  N  3  /  a  b  {  F  k  Z  :  O
PJ{vN3/ab{FkZ:O
Attached Files
File Type: sh password-generator.sh (416 Bytes, 90 views)
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote