$ pass init 2daygeek@gmail.com mkdir: created directory '/home/magi/.password-store/' Password store initialized for 2daygeek@gmail.com
上述命令将在 ~/.password-store 目录下创建一个密码存储区。
pass 命令提供了简单的语法来管理密码。 我们一个个来看,如何添加、编辑、生成和检索密码。
通过下面的命令检查目录结构树。
1 2 3 4 5 6 7
$ pass or $ pass ls or $ pass show Password Store
我没有看到任何树型结构,所以我们将根据我们的需求来创建一个。
插入一个新的密码信息
我们将通过运行以下命令来保存 gmail 的 id 及其密码。
1 2 3 4 5
$ pass insert eMail/2daygeek@gmail.com mkdir: created directory '/home/magi/.password-store/eMail' Enter password for eMail/2daygeek@gmail.com: Retype password for eMail/2daygeek@gmail.com:
执行重复操作,直到所有的密码插入完成。 比如保存 Facebook 密码。
1 2 3 4 5
$ pass insert Social/Facebook_2daygeek mkdir: created directory '/home/magi/.password-store/Social' Enter passwordfor Social/Facebook_2daygeek: Retype passwordfor Social/Facebook_2daygeek:
我们可以列出存储中的所有现有的密码。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
$ pass show Password Store ├── 2g ├── Bank ├── eMail │ ├── 2daygeek@gmail.com │ └── magesh.maruthamuthu@gmail.com ├── eMail ├── Social │ ├── Facebook_2daygeek │ └── Gplus_2daygeek ├── Social └── Sudha └── sudha21.magesh@gmail.com
$ pass generate eMail/2daygeek@gmail.com15 An entry already exists for eMail/2daygeek@gmail.com. Overwrite it? [y/N] y The generated password for eMail/2daygeek@gmail.com is: y!NZ<%T)5Iwym_S
生成没有符号的密码。
1 2 3 4 5
$ pass generate eMail/2daygeek@gmail.com15 -n An entry already exists for eMail/2daygeek@gmail.com. Overwrite it? [y/N] y The generated password for eMail/2daygeek@gmail.com is: TP9ACLyzUZUwBwO
$ pass rm eMail/2daygeek@gmail.com Are you sure you would like to delete eMail/2daygeek@gmail.com? [y/N] y removed '/home/magi/.password-store/eMail/2daygeek@gmail.com.gpg'