Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How does ssh know to use "pinentry"?
Date: Sun, 06 Jul 2014 02:57:19
Message-Id: CAGfcS_kQJjqj38cdDH9ZXBO5xMe8RBs3gryjP=UOH=jTJDc4=w@mail.gmail.com
In Reply to: [gentoo-user] How does ssh know to use "pinentry"? by Chris Stankevitz
1 On Sat, Jul 5, 2014 at 9:41 PM, Chris Stankevitz
2 <chrisstankevitz@×××××.com> wrote:
3 >
4 > ssh is asking me for my passphrase using a terrible program called
5 > "pinentry". It's terrible for a bunch of reasons, and if you are
6 > interested you can just google "pinentry sucks".
7 >
8
9 Probably more a case of "X11 sucks." Historically password entry into
10 X11 windows has always been problematic, because in general any client
11 connected to an X server can evesdrop on data entered into any other
12 window on the server. That is especially problematic when you
13 remember that X was supposed to work on a network. It isn't as bad on
14 your typical desktop setup, but applications like pinentry are often
15 designed with the network scenario in mind.
16
17 Imagine that you're on an X terminal at work. You have clients
18 connected to your terminal from 47 different servers that you
19 administer. Maybe you have firefox open from a workstation you
20 administer at customer A who is having firewall issues and you're
21 trying to get a sense of what things look like from inside. Perhaps
22 you have a mail client open on customer B's server. You punch in your
23 password for customer B so that the mail client can retrieve your mail
24 there, and now the trojaned firefox at customer A has your password
25 credentials for customer B. So, you have things like the feature in
26 xterm which captures all keyboard input so that you can enter a
27 password securely, but it probably breaks things like copy/paste and
28 you have to toggle it on/off since while it is on no other window on
29 your server can listen to the keyboard.
30
31 This wasn't really how X11 ended up being used, but back in the day it
32 was how it was designed to work. Well, except for the part where X11
33 is crippled when you have more than a few milliseconds in latency, so
34 nobody runs clients on remote servers. But, you still get all the
35 baggage.
36
37 I'm not familiar with the internals of pinentry, but this probably why
38 you're frustrated with it.
39
40 In any case, I suspect that gpg-agent is actually serving passwords to
41 openssh, so the file you want is ~/.gnupg/gpg-agent.conf - it probably
42 contains the line "pinentry-program /usr/bin/pinentry". If you trust
43 all your X clients you can set the option no-grab in the file which
44 will probably allow copy/paste/etc to work with the entry window.
45
46 Rich

Replies

Subject Author
Re: [gentoo-user] How does ssh know to use "pinentry"? Chris Stankevitz <chrisstankevitz@×××××.com>