gpg decryption fails with no secret key error

后端 未结 9 714
一生所求
一生所求 2020-12-13 17:48

I have a gpg .key file that is used as passphrase for decrypting a .dat.pgp file. The encrypted .data.pgp file gets successfully decrypted on one server with same .key file

9条回答
  •  醉话见心
    2020-12-13 18:21

    I got the same error when trying to decrypt the key from a different user account via su - . (Like jayhendren suggests in his answer)

    In my case, this happened because there would normally start a graphical pinentry prompt so I could enter the password to decrypt the key, but the su -ed to user had no access to the (graphical) X-Window-System that was currently running.

    The solution was to simply issue in that same console (as the user under which the X Server was currently running):

    xhost +local:

    Which gives other local users access to the currently running (local) X-Server. After that, the pinentry prompt appeared, I could enter the password to decrypt the key and it worked...

    Of course you can also forward X over ssh connections. For this look into ssh's -X parameter (client side) and X11Forwarding yes (server side).

提交回复
热议问题