otp命令行工具
keyring-otp的Python项目详细描述
Keyring OTP
keyring otp是一个cli,用于从存储在 Gnome Keyring (后端seahorse’s)。
目录
Installation
此应用程序在python3 virtual中的debian stretch上正常运行 环境:
$ python3 -m venv koptvenv $ source ./kotpvenv/bin/activate
这需要在您的计算机上xclip临时放入机密 你的剪贴板在程序的末尾,初始值回到 剪贴板:
$ apt install xclip
注意
如果您使用的是-o选项(控制台输出),则应用程序不会投诉 如果Xclip不在那里。
使用您喜爱的安装程序安装。例如:
$ pip install keyring-otp
Usage
使用-h获取最新帮助:
$ kotp -h usage: kotp [-h] [-s SECRET] [-o] [-d DURATION] keyring key CLI to generate One Time Password from secrets stored in Keyring (using seahorse password manager) positional arguments: keyring key optional arguments: -h, --help show this help message and exit -s SECRET, --secret SECRET Force using secret from command line instead getting it from the password manager. (as keyring and key are mandatory set any values they will be ignored). -o, --output Display output in console and in the clipboard (useful if you can't install xclip). -d DURATION, --duration DURATION How many seconds you wants the One Time Password in your clipboard. Note that as time is changing, the TOTP password will be updated and your clipboard will be updated too!
假设我有一个名为otp的密匙环,它包含一个名为github的密匙 wich包含我的github otp密码。
要在我的剪贴簿中获取基于时间的OTP密码,我需要:
$ kotp otp github
注意
在写入otpkeyring时,必须先解除锁定,然后才能运行 申请书。
下面是另一个在命令行中给出otp密码值的示例:
$ kotp -s SECRETS -o -d 35 nothing real Current TOTP 887562 at Wed Nov 8 07:48:18 2017 Current TOTP 291833 at Wed Nov 8 07:48:30 2017
警告
只要你的otp秘密在你的bash中,这个选项就不被鼓励。 历史记录,我们可以删除此选项,将其替换为 未来
Roadmap
- 使其可用作api,api使用者可以添加多个回调
一旦otp作为benn被改变就被调用(回调可以在入口点声明
为了方便用户定义新的回调,这个应用程序应该声明一些
默认行为如下:
- 在控制台中打印
- 填充剪贴板(需要init方法和final方法来设置 当前剪贴簿值)
- 提示解锁钥匙圈
- 考虑替换-s选项并打开机密输入以避免le跟踪 使用中的bash历史记录
- 使用python keyring使此应用程序具有更多的密码管理器可移植性: gnomekeyring(用于gnome环境)或kdewallet(用于kde环境) 或Win32CryptoRegistry(适用于Windows)
- 管理Passman后端
- 保存新机密