gpg not working without X server

archlinux-logo-dark-200dpi.b42bd35d5916

If you are trying to use gpg command for encrypt or decrypt data on tty without X server (I use that in combination with yadm, you will probably get this error:

gpg: public key decryption failed: Inappropriate ioctl for device

If you don’t want to switch to X every time, there is a simple solution.Put this line in your ~/.bashrc:

export GPG_TTY=$(tty)

Happy hacking…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s