`pass` 超时缓存主密码

Ult*_*awk 4 password gnupg

我使用名为pass. 它在第一次调用时要求提供主密码。它似乎缓存了主密码以避免重写它。出于安全原因,我想设置超时。

我已经查看了/usr/bin/pass. 我并没有因此变得更聪明。我的怀疑是gpg-agent与它有关。我尝试了这里的答案/评论。他们没有帮助。

问题:如何清除主密码缓存?
如果它有一个内置的超时,那就太好了。否则,它将只是一个简单的cronjob.

Rin*_*ind 5

如果您使用 gpg-agent,所有密码(包括主密码)都存储/保存在~/.password-store.

从“通行证”网站

将有一个使用标准的漂亮密码输入对话框gpg-agent可以配置为保持身份验证几分钟),因为所有密码都是加密的。

gpg-agent手册页

--default-cache-ttl n  Set the time a cache entry is valid to n seconds.       
The default is 600 seconds. 

--default-cache-ttl-ssh n Set the time a cache entry used for SSH keys 
is valid to n seconds. 
The default is 1800 seconds. 

--max-cache-ttl n  Set the maximum time a cache entry is valid to n seconds. 

After this time a cache entry will be expired even if it has been accessed recently. 
The default is 2 hours (7200 seconds). 

--max-cache-ttl-ssh n Set the maximum time a cache entry used for SSH keys is valid 
to n seconds. After this time a cache entry will be expired even if 
it has been accessed recently. 
The default is 2 hours (7200 seconds). 
Run Code Online (Sandbox Code Playgroud)

和 ...

gpg-agent.conf

这是 gpg-agent 在启动时读取的标准配置文件。它可能包含任何有效的多头选项;不能输入前导的两个破折号,也不能缩写选项。该文件也会在 SIGHUP 之后读取,但实际上只有少数选项会起作用。可以在命令行上更改此默认名称(请参阅:[option --options])。你应该备份这个文件。

这只会在您实际使用 gpg-agent 时读取。如果它是“海马”(Ubuntu 中的默认值),则忽略 gpg-agent)。

因此,您可以将 4 个参数中的任何一个放入配置文件,并以秒为单位保持密码有效(包括主密码,因为它也存储在 中)。要释放您可以使用的密码echo RELOADAGENT | gpg-connect-agent(有关更多选项,请参阅手册)。