11 月 272012
 

使用pwgen批量生成随机密码

安装

[root@oracle pwgen-2.06]# ./configure --prefix=/usr/local/pwgen
[root@oracle pwgen-2.06]# make
[root@oracle pwgen-2.06]# make install
mkdir -p /usr/local/pwgen/bin /usr/local/pwgen/man/man1
/usr/bin/install -c pwgen /usr/local/pwgen/bin/pwgen
/usr/bin/install -c -m 644 ./pwgen.1 /usr/local/pwgen/man/man1/pwgen.1
[root@oracle pwgen-2.06]#

查看帮助

[root@oracle bin]# ./pwgen --help
Usage: pwgen [ OPTIONS ] [ pw_length ] [ num_pw ]
Options supported by pwgen:
 -c or --capitalize
 Include at least one capital letter in the password
 -A or --no-capitalize
 Don't include capital letters in the password
 -n or --numerals
 Include at least one number in the password
 -0 or --no-numerals
 Don't include numbers in the password
 -y or --symbols
 Include at least one special symbol in the password
 -s or --secure
 Generate completely random passwords
 -B or --ambiguous
 Don't include ambiguous characters in the password
 -h or --help
 Print a help message
 -H or --sha1=path/to/file[#seed]
 Use sha1 hash of given file as a (not so) random generator
 -C
 Print the generated passwords in columns
 -1
 Don't print the generated passwords in columns
 -v or --no-vowels
 Do not use any vowels so as to avoid accidental nasty words

生成4组12位长度密码

[root@oracle bin]# ./pwgen 12 4
aik3ieC8oNee Chee6ririsi5 noiPo6aiquoo AeShaeriequ9

生成含有符号的4组12位长度密码

[root@oracle bin]# ./pwgen -y 12 4
uu!qu2Oobii4 kohM/ai6eith miReipi;th4e chu5ooj~ooNg

生成完全随机且含有符号的4组12位长度密码

[root@oracle bin]# ./pwgen -sy 12 4
g=~6J]!$}4Ws GK&0YCvj(pq~ AV`Q[Y|3wdwi ;0KUJ:f8bCCT

相关下载:
(1) pwgen 2.06

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)