Hacker News 中文摘要

RSS订阅

Pass:Unix 密码管理器 -- Pass: Unix Password Manager

文章摘要

pass是一款遵循Unix哲学的密码管理工具,通过gpg加密文件存储密码,文件名对应网站或资源名称。密码文件可组织成文件夹层次结构,并使用标准命令行工具管理。所有密码存储在~/.password-store中,pass提供添加、编辑、生成和检索密码的命令,支持剪贴板操作和git跟踪密码变更。用户可使用普通Unix命令和pass命令编辑密码库,无需学习新格式或范式,支持bashzsh的自动补全功能。

文章总结

标准Unix密码管理器:pass

pass 是一款遵循Unix哲学的密码管理工具,旨在简化密码管理流程。每个密码都存储在一个通过gpg加密的文件中,文件名通常为需要密码的网站或资源的名称。这些加密文件可以组织成有意义的文件夹结构,并在计算机之间复制,使用标准的命令行文件管理工具进行操作。

pass 使得管理这些密码文件变得非常简单。所有密码都存储在 ~/.password-store 目录下,pass 提供了一系列命令用于添加、编辑、生成和检索密码。它是一个非常简短且简单的shell脚本,能够将密码临时复制到剪贴板,并使用git跟踪密码的更改。

用户可以使用普通的Unix shell命令与pass命令一起编辑密码库,无需学习新的文件格式或范式。pass 还支持bash、zsh和fish的自动补全功能,用户只需按下Tab键即可填充名称和命令。此外,活跃的社区还为pass开发了许多客户端、GUI界面以及扩展功能。

使用密码库

用户可以通过pass命令列出所有现有的密码:

bash zx2c4@laptop ~ $ pass Password Store ├── Business │ ├── some-silly-business-site.com │ └── another-business-site.net ├── Email │ ├── donenfeld.com │ └── zx2c4.com └── France ├── bank ├── freebox └── mobilephone

还可以显示或复制密码到剪贴板:

```bash zx2c4@laptop ~ $ pass Email/zx2c4.com sup3rh4x3rizmynam3

zx2c4@laptop ~ $ pass -c Email/zx2c4.com Copied Email/jason@zx2c4.com to clipboard. Will clear in 45 seconds. ```

pass 还支持通过insert命令添加现有密码,并可以处理多行密码或其他数据。用户还可以使用generate命令生成新密码,并通过--no-symbols选项生成不含符号的密码,或使用--clip选项将密码直接复制到剪贴板。

设置密码库

初始化密码库只需一个简单的命令:

bash zx2c4@laptop ~ $ pass init "ZX2C4 Password Storage Key" mkdir: created directory ‘/home/zx2c4/.password-store’ Password store initialized for ZX2C4 Password Storage Key.

用户还可以将密码库初始化为一个git仓库,以便在团队环境中使用,并通过pass git pushpass git pull命令同步密码库。

数据组织

pass 不强制用户使用特定的数据组织方式,用户可以根据自己的需求选择存储密码、用户名、PIN码、网站URL等信息。常见的做法是将密码存储在多行文件的第一行,其他信息存储在后续行中。

扩展与客户端

pass 支持扩展功能,用户可以通过安装扩展来增强其功能。社区还开发了多种客户端和GUI界面,适用于不同的平台,如Android、iOS、Windows等。

迁移到pass

用户可以通过社区提供的脚本将其他密码管理器中的数据导入到pass中,例如从1Password、LastPass、KeePass等工具中导入密码。

贡献与许可

pass 由Jason A. Donenfeld开发,采用GPLv2+许可证。项目拥有活跃的贡献者社区,用户可以通过加入邮件列表或参与Libera.Chat上的讨论来贡献代码。

pass 是一款功能强大且灵活的密码管理工具,适合那些喜欢使用命令行和Unix哲学的用户。

评论总结

评论内容主要围绕密码管理工具“pass”的使用体验、优缺点以及与其他工具的对比展开。以下是总结:

支持使用pass的观点:

  1. 简单且灵活:pass基于命令行,适合技术用户,且可以通过Git同步密码库。

    • "I used pass for many years and loved it. I sync'd my password store between 3+ devices including my Android phone using a git remote." (hyperpl)
    • "Pass is great, but GPG keys are complicated and add a lot of extra overhead if you don't have one already." (jwgarber)
  2. 安全性高:支持硬件密钥(如Yubikey)和公钥加密,增强安全性。

    • "Your secret key can be stored in Yubikey, handled by a dedicated OpenPGP agent. This allows deriving a strong key from a weak one." (aborsy)
    • "It uses public key cryptography, and comes with its advantages. You don’t need your master password to add/encrypt passwords." (aborsy)
  3. 扩展性强:支持OTP生成、多设备共享等功能。

    • "There's also the pass-otp extension that generates OTPs!" (msravi)
    • "You can use it programmatically, eg, your backup script can grab a password from the store." (aborsy)

对pass的批评:

  1. 移动端支持不足:缺乏官方客户端,移动端体验较差。

    • "There is still no just-download clients for pass on mobile which I think is why it's not a good option." (obk0943t)
    • "I wish there were better OS/mobile integrations." (nixpulvis)
  2. GPG的复杂性:GPG密钥管理复杂,可能导致使用不便。

    • "Frankly I cannot recommend anyone use GPG today for any purpose." (jwgarber)
    • "Lately gpg is causing some troubles with Debian Trixie. GPG agent frequently locks the Yubikey and requires restarting pcscd." (aborsy)
  3. 企业环境不适用:缺乏多用户管理和审计功能,不适合企业使用。

    • "As a company password manager, there is no way to know who's accessed which secret across their lifetime at the firm." (lucb1e)
    • "There is no way to ever erase anything you’ve accidentally pushed, short of rewriting the git history and breaking it for everyone." (lucb1e)

与其他工具的对比:

  1. Bitwarden:更适合普通用户和企业环境,提供更好的跨平台支持。

    • "Growing tired of Bitwarden in the browser, so this is pretty intriguing. But its hard to forgo mobile compatibility." (andrewrn)
    • "I eventually switched to Bitwarden." (enkrs)
  2. KeePassXC/KeePassDX:提供更好的GUI支持和移动端体验。

    • "I decided to find the next best option and settled on keepassxc and KeePassDX." (hyperpl)
    • "KeepassXC on desktop + KeepassDX on Android is a better solution for normies." (drnick1)

其他工具推荐:

  1. gopass:pass的替代品,支持更多功能,如多GPG密钥管理。

    • "There is also a drop-in replacement with some extra features and a bit better UX in some parts." (tlamponi)
    • "https://www.gopass.pw/" (tlamponi)
  2. Passage:使用Age替代GPG,可能解决GPG的某些问题。

    • "There is a similar tool Passage using Age, maybe that solves it." (aborsy)
    • "https://words.filippo.io/passage/" (aborsy)

总结:pass是一款灵活且安全的密码管理工具,尤其适合技术用户,但在移动端支持、GPG复杂性和企业环境适用性方面存在不足。对于普通用户和企业环境,Bitwarden或KeePass系列可能是更好的选择。