<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 01/25/2018 03:03 AM, Werner Koch
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:877es6yzc0.fsf@wheatstone.g10code.de">
<blockquote type="cite" style="color: #000000;">
<pre wrap="">$ ssh some-host
fails to ask for the PIN.
</pre>
</blockquote>
<pre wrap="">That is because ssh has no mechanism to tell the ssh-agent (in this case
gpg-agent) the DISPLAY or tty to use for pinentry. This the pinentry
pops up on the tty or X server gpg-agent was initially started.
Running
gpg-connect-agent updatestartuptty /bye
on your current tty tells gpg-agent to updates its default tty and
DISPLAY to the one where you run gpg-connect-agent. ssh will then work
again. After you switch back to another terminal you need to do the
same.
I have to use it always when I move from my standalone laptop to the
Xserver connected to that laptop. It is a bit annoying and the only
clean solution would be to enance the the ssh-agent protocol and
implement that in both, ssh and gpg-agent.</pre>
</blockquote>
<p><font size="-1">One option could be to add that snippet of
code...</font></p>
<pre wrap=""> gpg-connect-agent updatestartuptty /bye
to your <i>.bashrc</i> (or equivalent) file. At the very least it might reduce the
number of times you would have to enter it manually.
Another option could be to create a script which calls gpg-connect-agent first
then calls SSH. Something like this:
$cat ~/bin/ssh
#!/usr/bin/env bash
gpg-connect-agent updatestartuptty /bye &>/dev/null
/usr/bin/ssh "$@"</pre>
<pre class="moz-signature" cols="72">--
Thank you for your time.
-Brian Saia
</pre>
</body>
</html>