安装
lwk@qwfys:~$ apt install pwgen
[sudo] password for lwk:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
pwgen
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 18.0 kB of archives.
After this operation, 52.2 kB of additional disk space will be used.
Get:1 http://mirrors.ustc.edu.cn/ubuntu bionic/universe amd64 pwgen amd64 2.08-1 [18.0 kB]
Fetched 18.0 kB in 7s (2,629 B/s)
Selecting previously unselected package pwgen.
(Reading database ... 491829 files and directories currently installed.)
Preparing to unpack .../pwgen_2.08-1_amd64.deb ...
Unpacking pwgen (2.08-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up pwgen (2.08-1) ...
用法
lwk@qwfys:~$ 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
-r <chars> or --remove-chars=<chars>
Remove characters from the set of characters to generate passwords
-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
用法示例
lwk@qwfys:~$ pwgen 14 1
ooyeiyoi1Shoob
lwk@qwfys:~$