Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

gpg: public key not found - how to tell gpg where to find the public key?

Discussion in 'General Discussion' started by spaceman, Nov 26, 2003.

  1. spaceman

    spaceman Well-Known Member

    Mar 25, 2002
    Likes Received:
    Trophy Points:
    In the 'Manage OpenPGP Keys' section of cPanel for one of my hosting accounts ('accname') I've just successfully imported a openPGP public key for a specific email address (let's call it If I navigate to /home/accname/.gnupg/ I can see some *.gpg files.

    OK, now I want to test gpg by encrypting a test text file that I created and stored here


    Logging in as root, I navigated here:


    and entered the following command:

    gpg -e -r test.txt

    But no luck: the error that came back was:

    gpg: skipped: public key not found
    gpg: test_message.txt: encryption failed: public key not found

    Where am I going wrong? Why can't gpg find the public key for Am I supposed to specify the exact path to the /home/accname/.gnupg folder as an option in the gpg command (and if so, how - I've studied man gpg and can't work it out)?

    All I want to do is to encrypt a plain text message on the server using gpg and my imported public key - I'm not bothered about trying to unencrypt.

    I believe it's irrelevant, but I found the gpg command in two places on my server:

    entering 'which gpg' at the command prompt tells me that /usr/local/bin/gpg is first choice.

    Thanks very much for you help.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. deev

    deev Registered

    Mar 6, 2006
    Likes Received:
    Trophy Points:
    Adelaide, Australia
    GPG encryption

    I am currently trying to encrypt form data using GPG to be sent to an email address. However am limited by the fact that this is being done using our ISP's web server which has cPanel installed (and no SSH access). I created the certificates using cPanel but can't seem to get gpg to encrypt a test text file using a simple php script. ANY help would be appreciated!

    Will happily provide the PHP scripts I've been using if anyone wants to see what I've done so far...


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice