> For the complete documentation index, see [llms.txt](https://til.devjugal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.devjugal.com/linux/gpg/fix-inappropriate-ioctl-for-device-error.md).

# Fix "Inappropriate ioctl for device" Error

`gpg: signing failed: Inappropriate ioctl for device` can be fixed by setting `GPG_TTY` variable -

### Solution:

```bash
export GPG_TTY=$(tty)
```

**Note:** Add above line to `~/.bashrc` file, to avoid running it everytime shell session starts.

***Source:*** [***GitHub***](https://github.com/keybase/keybase-issues/issues/2798#issue-205008630)
