gpg: Sorry, no terminal at all requested - can't get input
Asked Answered
W

4

43

When decrypting I get following error:

$ eyaml decrypt -s 'ENC and the key goes on here'
.gnupg --quiet --no-secmem-warning --no-permission-warning --no-tty --yes --decrypt)
failed with: gpg: Sorry, no terminal at all requested - can't get input

I have checked my keys, everything is in order. At this point I am out of options.

Whisper answered 29/7, 2016 at 12:43 Comment(1)
Can you reproduce the issue with a simpler command and update the question? I got the same error with a simple gpg --edit-key <my key id> which was resolved by Josh Habdas' answer.Omniumgatherum
B
65

If you configured Automatic Git commit signing with GPG on macOS and you see this error comment out no-tty in ~/.gnupg/gpg.conf as suggested by Fahl-Design.

enter image description here

This will also allow you to generate new GPG keys following the GitHub instructions for new keys.

Bartolommeo answered 4/7, 2018 at 12:49 Comment(0)
A
19

You need to remove the option --no-tty

--no-tty
Make sure that the TTY (terminal) is never used for any output. This option is needed in some cases because GnuPG sometimes prints warnings to the TTY even if --batch is used.

Anatolia answered 3/11, 2016 at 3:52 Comment(3)
if someone else finds this question/answer with other gpg commands check your ~/.gnupg/gpg.conf for the no-tty seting and disable itKunz
@josh-habdas yes, your are right. But I found this question by the error message title and had "no-tty" in my config (to use singed git commits with phpstorm)Kunz
Can I disable that option temporarily or per command?Pyrethrum
O
8

For those who are encountering this error from scripts that are running with no TTY available, adding --batch to the GPG command line, or batch to a line in ~/.gnupg/gpg.conf can make the problem go away.

Ovolo answered 14/4, 2021 at 22:20 Comment(3)
This helps for me to openExperience
This helped me, but a more permanent and global solution would be to follow @Kunz suggestion in a note to oden's answer: to edit your ~/.gnupg/gpg.conf by deleting your no-tty seting in case you have it there.Odontalgia
Depends on the situation. Some people are running GPG from a terminal and disabling no-tty would fix their problem. In my case, I was running GPG without a controlling tty, so I had to keep it.Ovolo
K
0

I had to update my git email so that it matched the email on my gpg key and the primary email on my Github.

$ git config --global user.email "[email protected]"
Kb answered 26/5, 2022 at 19:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.