mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

gpg: signing failed: Inappropriate ioctl for device

Open shibumi opened this issue 6 years ago • 2 comments

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..)

shibumi avatar Jul 23 '19 23:07 shibumi

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 avatar Aug 07 '20 20:08 DaanDeMeyer

@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)

shibumi avatar Aug 07 '20 20:08 shibumi