This is what I'm working with:

pwgen 15 1 -cny

I need to include at least one uppercase letter, one number and one symbol.

What I need to change is to make it include one of these symbols:

"! @ # $ % ^ * - _ + = & ~"

How do I do that?

1 Answer 1


You can use -r to specify list of characters to not be included in the password, so if you want only specific list of symbols to be used, you can use list of symbols pwgen uses, remove yours from the list and use it for -r.

pwgen 15 1 -cny -r "\"\'(),./:;<>?[\\]\`{|}"

Unfortunately this will stop working if pwgen ever decides to change the list of symbols but I don't see other way to do it with pwgen only.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .