Linux uses to generate a random password pwgen

Linux uses to generate a random password pwgen

1, download the installation package

sudo apt install pwgen 

2、pwgen -h

_ Depth theme selection area _20190814181622.png

  • pwgen [ OPTION ] [ pw_length ] [ num_pw ]
  • parameter:
-c or –capitalize 
密码中至少包含一个大写字母

-A or –no-capitalize 
密码中不包含大写字母

-n or –numerals 
密码中至少包含一个数字

-0 or –no-numerals 
密码中不包含数字

-y or –symbols 
密码中至少包含一个特殊符号

-s or –secure 
生成完全随机密码

-B or –ambiguous 
密码中不包含歧义字符(例如1,l,O,0)

-H or –sha1=path/to/file[#seed] 
使用SHA1 hash给定的文件作为一个随机种子

-C 
在列中打印生成的密码

-1 
不要在列中打印生成的密码,即一行一个密码

-v or –no-vowels 
不要使用任何元音,以避免偶然的脏话

3, examples

10-bit code generated

pwgen 10

_ Depth theme selection area _20190814181819.png

Generating a password 10

 pwgen 10 1

_ Depth theme selection area _20190814181958.png

10 generates a print line comprising a case letters, contains special symbols, numbers password

// 箭头指向的‘1’ 不是字母L 是数字1
pwgen -cny1 10 1

_ Depth theme selection area _20190814182235.png

Guess you like

Origin www.cnblogs.com/jakaBlog/p/11353879.html