LinuxTOY 是一个致力于提供 Linux 相关资讯的专题站点。如果您发现了好用好玩的 Linux 东东并愿意发扬自由、分享的精神,可以点击顶部导航 Contact 按钮进行投稿。

Related entries

  • No related posts

APG:密码生成器

为了得到安全的保障,我们在很多时候、很多地方都会用到密码。如果密码设得太简单,则安全性将大打折扣。想设置复杂的密码,又怕费脑力,何不使用密码生成工具来助你一臂之力。Automated Password Generator(简称“APG”)就是这样一个专门的密码生成器。

安装 APG

APG 这个工具在大多数 Linux 发行版的软件仓库中都有。因此,要安装它,你只需使用该发行版的包管理工具自动获取即可。

  • Archlinux:# pacman -S apg
  • Debian/Ubuntu:# apt-get install apg

使用 APG

不加任何参数在终端中执行 apg,将默认生成 6 个随机密码:

vodokByp
BappOtfo
dyocvith9
TeucOfPai
RyudEnbo
NantEcMa

上面是在我的系统中执行 apg 的结果。

为了增加密码的难度,可以给 apg 加一些参数:

  • m - 指生成密码的最小位数,默认是 8
  • M mode - 使用什么模式来生成密码,如密码包含大小写字母、数字、特殊字符等

例如,假设我们要生成一个 16 位且必须包含大写字母、小写字母、数字及特殊字符的密码,可以执行:

apg -M SNCL -m 16

其结果如下:

lev}TwookVadtak6
$onOdcedVoacyig8
Cyd6SlogOpchoik-
5Phu:SlujlepShug
vig4draynItbycs-
cevyet=ojRodreb3

关于 apg 更详细的用法,可以 man apg。

建议

生成密码不妨考虑“84”规则,即密码至少 8 位,外加至少 1 个大写字母、1 个小写字母、1 个数字及 1 个特殊字符。

署名 • 注明出处 • 非商业性使用

14 Comments

  1. 1 camphorli Commented @ 2008-08-25 9:56 amReply to this comment

    非常好!
    然后用笔记下来吗?

  2. 2 cooked_bird Commented @ 2008-08-25 10:33 amReply to this comment

    这种密码只有计算机能够记得住吧……

  3. 3 najja Commented @ 2008-08-25 10:48 amReply to this comment

    http://supergenpass.com/

    这个bookmarklet根据一个主密码和网站域名为每一个网站hash出一个独特的密码,login的时候只用输入主密码,bookmarklet自动填上真正的密码。我觉得挺好用滴。

  4. 4 NONE Commented @ 2008-08-25 11:21 amReply to this comment

    KeePassX,管理密码+密码生成器,一直在用,Qt4的,不依赖KDE。

  5. 5 leafduo Commented @ 2008-08-25 11:27 amReply to this comment

    作者能记住吗?

  6. 6 Sozi Commented @ 2008-08-25 12:31 pmReply to this comment

    我一直用的是 strongpasswordgenerator.com,还可以提示你如何记忆

  7. 7 fcicq Commented @ 2008-08-25 3:43 pmReply to this comment

    一个有点 ws 的办法…
    dd if=/dev/urandom bs=8 count=1 | base64

  8. 8 walkerxk Commented @ 2008-08-25 4:28 pmReply to this comment

    echo $RANDOM|md5sum|head -c8

  9. 9 xiaket Commented @ 2008-08-25 4:58 pmReply to this comment

    楼上这个位数太少了啊,就是一个十六进制数嘛。

  10. 10 Aspirin Commented @ 2008-08-25 4:58 pmReply to this comment

    。。。

    这个密码给谁记啊。。

  11. 11 雪梨 Commented @ 2008-08-25 5:41 pmReply to this comment

    这样的密码鬼记得住。
    所以真用这个弄密码的人,多还是将密码写下来/记录下来,
    安全性反而低

  12. 12 zhg Commented @ 2008-08-25 8:43 pmReply to this comment

    想密码的确是很烦人和頭疼的事,可以试一试

  13. 13 Xorcerer Commented @ 2008-08-26 3:22 pmReply to this comment

    用计算机生成的密码,当然用计算机记啦。
    gnome的key ring,Mac的key chain,都可以帮你记密码。

  14. 14 Tommy Commented @ 2008-08-27 2:07 pmReply to this comment

    我用keepassx,使用keepassx随机生成的密码,再用自己的密码保证keepassx数据的安全。