3 个 Linux 命令行密码管理器
密码 密码管理器

> 
> 给在终端窗口花费大量时间的人们的密码管理器。
> 
> 
> 


![](/data/attachment/album/201804/24/180338w6kvq6h8y2db54kh.jpg)


我们都希望我们的密码安全可靠。为此，许多人转向密码管理应用程序，如 [KeePassX](https://www.keepassx.org/) 和 [Bitwarden](https://opensource.com/article/18/3/managing-passwords-bitwarden)。


如果你在终端中花费了大量时间而且正在寻找更简单的解决方案，那么你需要了解下诸多的 Linux 命令行密码管理器。它们快速，易于使用且安全。


让我们来看看其中的三个。


### Titan


[Titan](https://www.titanpasswordmanager.org/) 是一个密码管理器，也可作为文件加密工具。我不确定 Titan 在加密文件方面效果有多好；我只是把它看作密码管理器，在这方面，它确实做的很好。


![](/data/attachment/album/201804/24/180339zis1bt8io8kgqq2g.png)


Titan 将你的密码存储在加密的 [SQLite 数据库](https://en.wikipedia.org/wiki/SQLite)中，你可以在第一次启动该应用程序时创建并添加主密码。告诉 Titan 增加一个密码，它需要一个用来识别它的名字、用户名、密码本身、URL 和关于密码的注释。


你可以让 Titan 为你生成一个密码，你可以通过条目名称或数字 ID、名称、注释或使用正则表达式来搜索数据库，但是，查看特定的密码可能会有点笨拙，你要么必须列出所有密码滚动查找你想要使用的密码，要么你可以通过使用其数字 ID（如果你知道）列出条目的详细信息来查看密码。


### Gopass


[Gopass](https://www.justwatch.com/gopass/) 被称为“团队密码管理器”。不要因此感到失望，它对个人的使用也很好。


![](/data/attachment/album/201804/24/180340g2o5dj5fc3jbfb56.png)


Gopass 是用 Go 语言编写的经典 Unix 和 Linux [Pass](https://www.passwordstore.org/) 密码管理器的更新版本。安装纯正的 Linux 方式，你可以[编译源代码](https://github.com/justwatchcom/gopass)或[使用安装程序](https://justwatch.com/gopass/#install)以在你的计算机上使用 gopass。


在开始使用 gopass 之前，确保你的系统上有 [GNU Privacy Guard (GPG)](https://www.gnupg.org) 和 [Git](https://git-scm.com/)。前者对你的密码存储进行加密和解密，后者将提交到一个 [Git 仓库](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository)。如果 gopass 是给个人使用，你仍然需要 Git。你不需要担心提交到仓库。如果你感兴趣，你可以[在文档中](https://github.com/justwatchcom/gopass/blob/master/docs/setup.md)了解这些依赖关系。


当你第一次启动 gopass 时，你需要创建一个密码存储库并生成一个[密钥](http://searchsecurity.techtarget.com/definition/private-key)以确保存储的安全。当你想添加一个密码（gopass 中称之为“secret”）时，gopass 会要求你提供一些信息，比如 URL、用户名和密码。你可以让 gopass 为你添加的“secret”生成密码，或者你可以自己输入密码。


根据需要，你可以编辑、查看或删除密码。你还可以查看特定的密码或将其复制到剪贴板，以将其粘贴到登录表单或窗口中。


### Kpcli


许多人选择的是开源密码管理器 [KeePass](https://keepass.info/) 和 [KeePassX](https://www.keepassx.org)。 [Kpcli](http://kpcli.sourceforge.net/) 将 KeePass 和 KeePassX 的功能带到你的终端窗口。


![](/data/attachment/album/201804/24/180340vshhmjirx2hs7pj7.png)


Kpcli 是一个键盘驱动的 shell，可以完成其图形化的表亲的大部分功能。这包括打开密码数据库、添加和编辑密码和组（组帮助你组织密码），甚至重命名或删除密码和组。


当你需要时，你可以将用户名和密码复制到剪贴板以粘贴到登录表单中。为了保证这些信息的安全，kpcli 也有清除剪贴板的命令。对于一个小终端应用程序来说还不错。


你有最喜欢的命令行密码管理器吗？何不通过发表评论来分享它？




---


via: <https://opensource.com/article/18/4/3-password-managers-linux-command-line>


作者：[Scott Nesbitt](https://opensource.com/users/scottnesbitt) 选题：[lujun9972](https://github.com/lujun9972) 译者：[MjSeven](https://github.com/MjSeven) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
We all want our passwords to be safe and secure. To do that, many people turn to password management applications like [KeePassX](https://www.keepassx.org/) or [Bitwarden](https://opensource.com/article/18/3/managing-passwords-bitwarden).

If you spend a lot of time in a terminal window and are looking for a simpler solution, you'll want to check out one of the many password managers for the Linux command line. They're quick, easy to use, and secure.

Let's take a look at three of them.

## Titan

[Titan](https://www.titanpasswordmanager.org/) is a password manager that doubles as a file-encryption tool. I'm not sure how well Titan works at encrypting files; I only looked at it as a password manager. In that capacity, it does a solid job.

![Titan](https://opensource.com/sites/default/files/u128651/titan.png)

opensource.com

Titan stores your passwords in an encrypted [SQLite database](https://en.wikipedia.org/wiki/SQLite), which you create and add a master passphrase to when you first fire up the application. Tell Titan to add a password and it asks for a name to identify it, a username, the password itself, a URL, and a comment about the password.


You can get Titan to generate a password for you, and you can search your database by an entry's name or numeric ID, by the name or comment, or using regular expressions. Viewing a specific password, however, can be a bit clunky. You either have to list all passwords and scroll through them to find the one you want to use, or you can view the password by listing the details of an entry using its numeric ID (if you know it).

## Gopass

[Gopass](https://www.justwatch.com/gopass/) is billed as "the team password manager." Don't let that put you off. It's also great for personal use.

![gopass](https://opensource.com/sites/default/files/u128651/gopass.png)

opensource.com

Gopass is an update of the venerable Unix and Linux [Pass](https://www.passwordstore.org/) password manager written in the Go programming language. In true Linux fashion, you can either [compile the source code](https://github.com/justwatchcom/gopass) or [use an installer](https://justwatch.com/gopass/#install) to get gopass on your computer.

Before you start using gopass, make sure you have [GNU Privacy Guard (GPG)](https://www.gnupg.org) and [Git](https://git-scm.com/) on your system. The former encrypts and decrypts your password store, and the latter signs commits to a [Git repository](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository). If gopass is for personal use, you still need Git. You just don't need to worry about signing commits. If you're interested, you can learn about those dependencies [in the documentation](https://github.com/justwatchcom/gopass/blob/master/docs/setup.md).

When you first start gopass, you need to create a password store and generate a [secret key](http://searchsecurity.techtarget.com/definition/private-key) to secure that store. When you want to add a password (which gopass refers to as a *secret*), gopass asks you for information such as a URL, a username, and a note about the secret. You can have gopass generate the password for the secret you're adding, or you can enter one yourself.

As you need to, you can edit, view, or delete passwords. You can also view a specific password or copy it to your clipboard to paste it into a login form or window.

## Kpcli

The open source password manager of choice for many people is either [KeePass](https://keepass.info/) or [KeePassX](https://www.keepassx.org). [Kpcli](http://kpcli.sourceforge.net/) brings the features of KeePass and KeePassX to your nearest terminal window.

![kpcli](https://opensource.com/sites/default/files/u128651/kpcli.png)

opensource.com

Kpcli is a keyboard-driven shell that does most of what its graphical cousins can do. That includes opening a password database; adding and editing passwords and groups (which help you organize your passwords); or even renaming or deleting passwords and groups.

When you need to, you can copy a username and password to your clipboard to paste into a login form. To keep that information safe, kpcli also has a command to clear the clipboard. Not bad for a little terminal app.

Do you have a favorite command-line password manager? Why not share it by leaving a comment?

## 10 Comments