6th November 2016 Linux 24 Comments https://d.sb/B5N
Error: gpg: using "D5673F3E" as default secret key for signing
Error: gpg: signing failed: Inappropriate ioctl for device
Error: gpg: [stdin]: sign+encrypt failed: Inappropriate ioctl for device
It turns out this error is due to changes in GnuPG 2.1, which only recently landed in Debian Testing. The error occurs because GnuPG 2.1 by default ignores passphrases passed in via environment variables or stdin, and is trying to show a pinentry prompt. "Inappropriate ioctl for device" is thrown because the Backupninja script is not running through a TTY, so there's no way to actually render the prompt.
To solve the problem, you need to enable loopback pinentry mode. Add this to ~/.gnupg/gpg.conf:
use-agent
pinentry-mode loopback
And add this to ~/.gnupg/gpg-agent.conf, creating the file if it doesn't already exist:
allow-loopback-pinentry
Then restart the agent with echo RELOADAGENT | gpg-connect-agent
and you should be good to go!
Source: https://d.sb/2016/11/gpg-inappropriate-ioctl-for-device-errors
my case is below
before :
SPA Packet: 'EMA/xwCoedBdBOAQf7BC/CZfA+Gy5gHXcfAkX3/+O8Mh3GVbgrmDiPf4LFvDhnMRgQtfsb9ODGXzT9uzFpVLK9Sq9icKkepIfgDgQAZjqN8acRn36E/QXRBAVIe4up
(stanza #1) Error creating fko context: Decryption operation failed
(stanza #1) - GPG ERROR: Inappropriate ioctl for device
after:
SPA Packet: 'EMA/xwCoedBdBOAQf/YDD+2UBnh8AhEbfu7H+D9Fedgd6b6BBaJLUkQqA/grGtNw/cvdYOPLgscO69x3iqR8alWC+pTo+m2A7ijRLiKjbLr1FXYa9mdGy4gmp+BolMrND
7월 10 16:17:04 future-vmwarevirtualplatform fwknopd[4472]: [10.31.62.2] (stanza #1) SPA Decode (res=0):
7월 10 16:17:04 future-vmwarevirtualplatform fwknopd[4472]: SPA Field Values:
=================
Random Value: 1488985267871798
Username: future
Timestamp: 1752131824