gpg don't work under ctrl alt F1 terminal [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

Post Reply
mrizzone
Simple Hen
Posts: 96
Joined: Sun Feb 10, 2013 23:56

gpg don't work under ctrl alt F1 terminal [Solved]

Post by mrizzone » Sat Feb 23, 2013 0:01

Hello! When I open a terminal with CTRL ALT F1 and run gpg, it fails in generating a new key. The process is OK until the end, when i get this message:

pinentry 12311 gtk warning ** cannot open display
gpg agent 12310 can't connect to the pin entry module: end of file
gpg agent 12310 command get_passphrase cancelled: no pinentry

Works OK when I run gpg under GUI terminal. Any clue?

Thanks!
Last edited by mrizzone on Sat Feb 23, 2013 16:50, edited 1 time in total.

Ryuno-Ki
Old Dear Hen
Posts: 480
Joined: Mon Feb 27, 2012 22:15
Location: Southern Germany
Contact:

Re: gpg don't work under CTRL ALT F1 terminal

Post by Ryuno-Ki » Sat Feb 23, 2013 0:33

The virtual command, which you use via Ctrl+Alt+F1, has no DISPLAY var.

Code: Select all

DISPLAY=:0 yourgpgcommandhere
Not tested, but Gtk is a graphic library ;)
German Wiki translator ◆ Want to contribute on the wiki? Ask the Bureaucrats!
Please, mark solved threads ◆ Posts unread and unansweredPackage requests

svantoviit
Old Dear Hen
Posts: 724
Joined: Sun Feb 28, 2010 17:55
Contact:

Re: gpg don't work under CTRL ALT F1 terminal

Post by svantoviit » Sat Feb 23, 2013 10:47

I would try to
  1. edit ~/.gnupg/gpg-agent.conf and change

    Code: Select all

    pinentry-program /usr/bin/pinentry-gtk-2
    to

    Code: Select all

    pinentry-program /usr/bin/pinentry-curses
    Update: This method actually works for me
    After editing the conf file you need to restart the agent

    Code: Select all

    gpgconf --reload gpg-agent
    In addition I have the following lines in my ~/.bashrc

    Code: Select all

    GPG_TTY=$(tty)
    export GPG_TTY
    but actually don't know if it's really needed.

    or
  2. change the pinentry implementation using eselect

    Code: Select all

    $ eselect pinentry list
    Available pinentry implementations:
      [1]   pinentry-gtk-2 *
      [2]   pinentry-qt4
      [3]   pinentry-curses
    $ eselect pinentry set 3
    
Comment: The DISPLAY method as suggested by Ryuno-Ki displays the pinentry-gtk window in your running X, so you could switch to it (Ctrl-Alt-F7) and enter the password there.

Ryuno-Ki
Old Dear Hen
Posts: 480
Joined: Mon Feb 27, 2012 22:15
Location: Southern Germany
Contact:

Re: gpg don't work under CTRL ALT F1 terminal

Post by Ryuno-Ki » Sat Feb 23, 2013 11:37

svantoviit wrote:

Code: Select all

GPG_TTY=$(tty)
export GPG_TTY
You can put that in one line:

Code: Select all

export FOO=$(echo 'bar')
svantoviit wrote:Comment: The DISPLAY method as suggested by Ryuno-Ki displays the pinentry-gtk window in your running X, so you could switch to it (Ctrl-Alt-F7) and enter the password there.
Correct.
German Wiki translator ◆ Want to contribute on the wiki? Ask the Bureaucrats!
Please, mark solved threads ◆ Posts unread and unansweredPackage requests

mrizzone
Simple Hen
Posts: 96
Joined: Sun Feb 10, 2013 23:56

Re: gpg don't work under CTRL ALT F1 terminal

Post by mrizzone » Sat Feb 23, 2013 15:29

Whit gpgconf --reload gpg-agent was enough. Works better than new, thanks!


Post Reply