我的.gnupg
目录位于使用 Veracrypt 加密的 USB 驱动器中。列出公钥可以gpg --homedir <path-to-usb-gnupg-dir> --list-keys
正常工作,但是在尝试列出私钥时会出现问题--list-secret-keys
:
~ % gpg --homedir <path-to-usb-gnupg-dir> --list-secret-keys
gpg: error running '/opt/homebrew/Cellar/gnupg/2.4.3/bin/gpg-agent': exit status 2
gpg: failed to start gpg-agent '/opt/homebrew/Cellar/gnupg/2.4.3/bin/gpg-agent': General error
gpg: can't connect to the gpg-agent: General error
gpg: error running '/opt/homebrew/Cellar/gnupg/2.4.3/bin/gpg-agent': exit status 2
gpg: failed to start gpg-agent '/opt/homebrew/Cellar/gnupg/2.4.3/bin/gpg-agent': General error
gpg: can't connect to the gpg-agent: General error
我想这是因为挂载的容器的文件和目录权限不正确,发现Veracrypt有一个--fs-options
命令(也在这个线程中讨论过)。问题是这个命令显然在 MacOS 上不起作用,因为运行它会生成以下错误:
Unknown long option 'fs-options'
Error: Incorrect command line specified.
我还尝试使用 将该.gnupg
目录符号链接到我的主文件夹ln -s <path-to-usb-gnupg-dir> ~/.gnupg-usb
,但错误仍然存在。此设置有任何可能的解决方法吗?