0

Are my ./gnupg files permission correct on Debian?

drwx------  2 user user 4096 Feb  2 09:38 .
drwxr-xr-x 24 root root 4096 Feb  2 09:39 ..
-rw-------  1 user user 9188 Feb  1 11:03 gpg.conf
-rw-------  1 user user  680 Feb  1 11:04 pubring.gpg
-rw-------  1 user user  680 Feb  1 11:04 pubring.gpg~
-rw-------  1 user user  600 Feb  1 11:04 random_seed
-rw-------  1 user user 1420 Feb  1 11:04 secring.gpg
-rw-------  1 user user 1280 Feb  1 11:04 trustdb.gpg

My Script echo following error with echo $gpg->geterror();:

putenv("GNUPGHOME =/home/user/.gnupg");
$gpg = new gnupg();
$key = $gpg->import($user_details->pgp);
$gpg->addencryptkey($key['fingerprint']);
$enc = $gpg->encrypt($secret);
$gpg->clearencryptkeys();
echo $gpg->geterror();

Error: no key for encrypten set

Thanks

  • 1
    Are you calling the script using CLI or through a webserver in your browser? In the second case, the file permissions should match the permissions of your webserver – Nico Haase Feb 03 '18 at 11:21
  • Web Browser. I am User, i think they are correct, but cant generate an key and i dont understand the error. What means it "no key for encrypten set"? –  Feb 03 '18 at 11:25
  • With which user does your webserver run? Really with user, not using `www-data` or `apache`? And this error message sounds really strange - if you google it, there are no answers. If you google "no key for encryption set", you will very soon find similar problems based on file permissions – Nico Haase Feb 03 '18 at 11:28
  • Server is "root" and i use nginx not apache. i dont find anything on google,correct :/ –  Feb 03 '18 at 11:35
  • What are the correct server permission? –  Feb 03 '18 at 12:01

0 Answers0