0

I have a problem in using gpg on linux boot up (Debian).

I have a process that is being loaded on bootup using rc.local. This process will call gpg verify API's using gpgme. I found out that by running the process manually gpg works fine, while when the process is loaded using rc.local gpg doesn't work. (rc.local runs on boot up.) I get no keys on boot up when I try:

gpg --list-keys

I am guessing that the rc.local is being called before loading the keys (trustdb.gpg). Do you know where in the kernal on boot up we load the public gpg keys?

4

1 回答 1

0

您在 rc.local 中运行的脚本是否具有适当的权限(即,它是否向有权读取 gpg db 的用户以外的用户起诉?)root 当然总是可以访问,但是当 gpg db创建它总是在用户特定的级别上,所以如果该用户没有访问权限,它将无法工作。正如上面的评论所说,su 到正确的用户,并指定 gpg 主目录:

su user

gpg --homedir ~/.gnupg.userkeyring
于 2013-09-04T13:03:53.700 回答