}

gpg: signing failed: Inappropriate ioctl for device

The problem

Reproduce the problem with the following command:

echo "test" | gpg --clearsign

If you got the error:

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

Try the following solutions.

Solution 1

Execute on the terminal:

export GPG_TTY=$(tty)

Problem should be solved now.

Leonardo Lazzaro

Software engineer and technical writer. 10+ years experience in DevOps, Python, and Linux systems.

More articles by Leonardo Lazzaro