【问题标题】:pwgen - limit special characterspwgen - 限制特殊字符
【发布时间】:2018-10-25 16:09:27
【问题描述】:

我正在研究密码轮换自动化,其中一项任务是生成安全密码。我找到了 pwgen,它运行良好。

我需要将特殊字符限制为 ! # $ % - _ = + .任何指针?

pwgen -s -N 1 -cny 10

现在我使用 -r 来排除我不需要的那些。想知道是否有更简单的选择加入而不是选择退出的方法

pwgen -cny -B -1 -r \'\"\@\?\^\&\*\(\)\`\:\~\?\;\:\[\]\{\}\.\,\\\/\| 15

【问题讨论】:

    标签: passwords


    【解决方案1】:

    pwgen 中(目前)没有选项可以执行此操作(请参阅作者的README.md)。如果您在 Linux 上工作,以下选项可能适合您:

    1) Open $HOME/.bash_rc in a text editor
    2) Somewhere near the bottom, add these lines:
    
    # Use with pwgen (password generator) to remove special characters
    export PWGEN_SPECIAL=\'\"\@\?\^\&\*\(\)\`\:\~\?\;\:\[\]\{\}\.\,\\\/\|
    
    3) Close, save and open new Terminal
    4) pwgen -sy 10 1 -r $PWGEN_SPECIAL
    

    同样的解决方案,但比每次都输入一个复杂的排除列表要简单一些!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-30
      • 2020-05-30
      • 2017-02-21
      • 1970-01-01
      • 1970-01-01
      • 2012-04-24
      • 2019-08-18
      • 1970-01-01
      相关资源
      最近更新 更多