gpg: signing failed: Inappropriate ioctl for device
When mkosi is called via SSH on a remote host, the following error occurs, while signing the archive or image:
gpg: signing failed: Inappropriate ioctl for device
This error can be fixed with the following line in the remot shell:
export GPG_TTY=$(tty)
It would be nice if mkosi would set this line to mitigate the issue. (I know the bug is clearly on the side of GPG.. sigh..)
I guess we can do this. Would be even better if we can detect remote shell and only apply in that case. PRs appreciated!
@DaanDeMeyer We can check for SSH_CLIENT SSH_TTY or SSH_CONNECTION. If we encounter one of those environment variables we are in an SSH session.
So everything what it would need is max 10 lines of code that check for one of these variables and then setting GPG_TTY=$(tty)