Terminal password tool Passpie

Brief introduction

GitHub
official website

Passpie is a command-line tool from the terminal through a variety password management configuration interface. Use master password to decrypt the login credentials, copy passwords to the clipboard, synchronized with the git repository, check the password status.

Password file encryption using GnuPG yaml and saved to a text file. Passpie support Linux, MAC and Windows.
Passpie

Usage Example

$ passpie init
$ passpie add [email protected] --random
$ passpie add [email protected] --pattern"[0-9]{5}[a-z]{5}"
$ passpie update foo@example --comment"Hello"

# 输出
$ passpie
╒═════════════╤═════════╤════════════╤═══════════╕
│ Name        │ Login   │ Password   │ Comment   │
╞═════════════╪═════════╪════════════╪═══════════╡
│ example.com │ bar     │ *****      │           │
├─────────────┼─────────┼────────────┼───────────┤
│ example.com │ foo     │ *****      │ Hello     │
╘═════════════╧═════════╧════════════╧═══════════╛

# 复制密码
$ passpie copy [email protected]

 

工具特点

★添加,更新,删除凭证
★管理多个数据库。 本地和远程
★将密码复制到剪贴板或标准输出
★将凭证列为带有彩色输出的表格
★通过名称,登录名,注释或规则表达搜索凭证
★按名称分组凭证
★使用〜/ .passpie或.config进行配置
★使用git的版本控制passpie数据库
★更改密码短语并重新加密数据库
★出口凭证
★导入凭证
★生成随机密码
★生成数据库状态报告
★BASH / ZSH / FISH完成
★撤消/重做对数据库的更改。 (需要git)
★设置个人gpg密钥接收者
★每个数据库密钥环

安装

Passpie依赖于 GnuPG 加密

$ pip install passpie
#mac
$ brew install passpie

工具使用

命令各式

用法: passpie [OPTIONS] COMMAND [ARGS]...
选项:
  -D, --database TEXT  Database path or url to remote repository
  --autopull TEXT      Autopull changes from remote pository
  --autopush TEXT      Autopush changes to remote pository
  --config PATH        Path to configuration file
  -v, --verbose        Activate verbose output
  --version            Show the version and exit.
  --help               Show this message and exit.
命令:
  add       Add new credential to database
  complete  Generate completion scripts for shells
  config    Show current configuration for shell
  copy      Copy credential password to clipboard/stdout
  export    Export credentials in plain text
  import    Import credentials from path
  init      Initialize new passpie database
  list      Print credential as a table
  log       Shows passpie database changes history
  purge     Remove all credentials from database
  remove    Remove credential
  reset     Renew passpie database and re-encrypt...
  search    Search credentials by regular expressions
  status    Diagnose database for improvements
  update    Update credential

示例远程密码数据库

语法

使用全名语法查询Passpie。 全名语法一次性处理凭据的登录名和名称,以更快地添加和查询凭据。
全名由login@name组成。登录是可选的。全名有三种可能的格式:

login@name
@name
name

例如,使用@name语法添加凭据

$ passpie add @banks/mybank --password 1234
$ passpie add @banks/myotherbank --password 5678
$ passpie
╒═══════════════════╤═════════╤════════════╤═══════════╕
│ Name              │ Login   │ Password   │ Comment   │
╞═══════════════════╪═════════╪════════════╪═══════════╡
│ banks/mybank      │         │ *****      │           │
├───────────────────┼─────────┼────────────┼───────────┤
│ banks/myotherbank │         │ *****      │           │
╘═══════════════════╧═════════╧════════════╧═══════════╛
#因为登录是可选的。您可以查询凭证
$ passpie update @banks/mybank --random
#或者更好,不使用@符号
$ passpie update banks/mybank --random

随机密码

可以通过genpass模式配置设置随机密码模式

# 添加凭证与使用进行随机密码
passpie add [email protected]
# 使用随机密码覆盖模式添加凭据
passpie add [email protected] --pattern '[0-9]{5}[a-z]{5}'

#使用随机密码模式更新凭据
passpie update [email protected] --pattern "[0-9\#\$\%\w\ ]{32}"

# 使用随机密码添加凭据并将生成的密码复制到剪贴板
passpie add [email protected] --copy --pattern '[0-9]{5}[a-z]{5}'

搜索

# 搜索凭据字符串"exam"
$ passpie search exam

# 使用正则表达式搜索凭据
$ passpie search '[fF]oo|bar'

复制到剪切板

# 密码复制到剪贴板使用“login@name ' '
$ passpie copy [email protected]

# 仅使用' ' name ' ' '复制密码应该只存在一个名为' ' example.com ' '的凭据
$ passpie copy example.com

添加或更新并复制

# 使用随机密码模式添加凭据
$ passpie add [email protected] --random --pattern '[0-9]{5}[a-z]{5}'

# 使用随机密码模式更新凭据
$ passpie update [email protected] --random --pattern "[0-9\#\$\%\w\ ]{32}"

# 使用随机密码添加凭据并将生成的密码复制到剪贴板
$ passpie add [email protected] --copy --random --pattern '[0-9]{5}[a-z]{5}'

版本管控

默认情况下,如果安装了git,所有数据库都使用git存储库进行初始化

#初始化
$ passpie init

#避免初始化git
$ passpie init --no-git

#显示日志
$ passpie log
[13] Updated foo@bar
[12] Updated foo@bar
[11] Reset database
[10] Removed foozy@bar
[9] Updated hello@world
[8] Added hello@world
[7] Added foozy@bar
[6] Updated test@github
[5] Added foozy@bazzy
[4] Updated test@github
[3] Added foo@bar
[2] Added spam@egg
[1] Added test@github
[0] Initialized database

配置

Passie配置文件是yaml文件。 Passpie支持本地和全局配置文件。 设置本地数据库。
全局密码配置文件位于〜/.passpierc中,而本地配置文件作为.config文件位于数据库目录中。

  • 完整的密码配置文件
path: ~/.passpie
homedir: ~/.gnupg
autopull: null
autopush: null
copy_timeout: 0
extension: .pass
genpass_pattern: "[a-z]{5} [-_+=*&%$#]{5} [A-Z]{5}"
headers:
  - name
  - login
  - password
  - comment
aliases:
  st: status
  rm: remove
  ls: list
colors:
  login: green
  name: yellow
key_length: 4096
recipient: null
repo: true
status_repeated_passwords_limit: 5
table_format: fancy_grid
  • Configuration
recipient: [email protected]
copy_timeout: 10
extension: .gpg
table_format: rst

debugging

For debugging, the actual passpie configuration check command may be useful

# Global configuration found on ~/.passpierc
passpie config global

# Local configuration found on $PASSPIE_DATABASE/.config
passpie config local

go back

If you want to return to the previous version of the database history: passpie - reset-to N, where N is the index change

#注意:这是一个破坏数据的操作。请谨慎使用。这相当于做git reset --hard HEAD~N
$ passpie log --reset-to 5

Multi-database

For higher security, sometimes using multiple databases with different passwords is useful. You can use the -D option or --database to complete.

# 创建数据库
passpie -D ~/credentials/personal init
passpie -D ~/credentials/work init
passpie -D ~/credentials/junk init

#密码添加到特定到数据库 
passpie -D ~/credentials/personal add [email protected] --random
passpie -D ~/credentials/work add [email protected] --random
passpie -D ~/credentials/junk add [email protected] --random

# 查看特定到数据库
passpie -D ~/databases/junk

Use git remote database

# 列出来自远程数据库的凭据
$ passpie -D https://[email protected]/user/repo.git

#向远程数据库添加凭据并自动启用更改
$ passpie -D https://[email protected]/user/repo.git --autopush "origin/master" add [email protected]

#导出环境变量
export PASSPIE_DATABASE=https://[email protected]/user/repo.git
export PASSPIE_AUTOPULL=origin/master
export PASSPIE_AUTOPUSH=origin/master


#远程列表凭据
passpie

# 远程复制“[email protected]”密码
passpie copy [email protected]

# 直接将带有随机密码的凭据添加到远程
passpie add [email protected] --random --pattern "[0-9\#\$\%\w\ ]{32}"
passpie add [email protected] --random --pattern "[0-9\#\$\%\w\ ]{32}"


Packet credentials

Add credentials with the same name, and group them accordingly

# add some credentials
passpie add [email protected] --comment "Jonh main mail" --random
passpie add [email protected] --comment "No comment" --random
$ passpie
╒═════════════╤═════════╤════════════╤════════════════╕
│ Name        │ Login   │ Password   │ Comment        │
╞═════════════╪═════════╪════════════╪════════════════╡
│ example.com │ doe     │ *****      │ No comment     │
├─────────────┼─────────┼────────────┼────────────────┤
│ example.com │ jonh    │ *****      │ Jonh main mail │
╘═════════════╧═════════╧════════════╧════════════════╛

Use document

Getting Started

Guess you like

Origin www.cnblogs.com/zpsoe/p/zhong-duan-mi-ma-gong-ju-passpie.html