← 返回命令列表

Linux command

pwgen 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Generate a password

pwgen

Generate password

pwgen [16]

Generate multiple passwords

pwgen [16] [5]

Generate secure password

pwgen -s [16]

Generate with at least one symbol

pwgen -y [16]

Generate without ambiguous characters

pwgen -B [16]

Generate single password

pwgen -1 [16]

Generate completely random

pwgen -sy [20] [1]

说明

pwgen generates random, pronounceable passwords. By default, it creates passwords designed to be easily memorized by humans while still being reasonably secure. The tool can generate different styles of passwords: pronounceable (default), completely random, with or without special characters, and with various constraints. It outputs multiple passwords allowing users to choose one they find memorable. pwgen is commonly used for creating initial passwords, generating secrets for scripts, and batch password creation.

参数

-s, --secure
Generate completely random passwords.
-y, --symbols
Include at least one special character.
-n, --numerals
Include at least one number.
-c, --capitalize
Include at least one capital letter.
-A, --no-capitalize
No capital letters.
-0, --no-numerals
No numbers.
-B, --ambiguous
Avoid ambiguous characters (0O1lI).
-1
Print one password per line.
-v, --no-vowels
No vowels (avoid offensive words).
-H _file_, --sha1= _file_
Use SHA1 hash of file as seed.
-r _chars_
Remove specified characters.

FAQ

What is the pwgen command used for?

pwgen generates random, pronounceable passwords. By default, it creates passwords designed to be easily memorized by humans while still being reasonably secure. The tool can generate different styles of passwords: pronounceable (default), completely random, with or without special characters, and with various constraints. It outputs multiple passwords allowing users to choose one they find memorable. pwgen is commonly used for creating initial passwords, generating secrets for scripts, and batch password creation.

How do I run a basic pwgen example?

Run `pwgen` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -s, --secure do in pwgen?

Generate completely random passwords.