Cannot export SSH public key
Felix E. Klee
felix.klee at inka.de
Fri Jan 5 21:58:37 CET 2024
On Fri, Jan 5, 2024 at 2:43 PM Werner Koch <wk at gnupg.org> wrote:
> That is right. The ssh-agent protocol has no means to tell the
> ssh-agent or gpg-agent some important environment cariabales, like the
> current tty or DISPLAY.
Interesting, thanks for the look behind the scenes!
> I am so used to run the updatestartuptty that I don't even think about
> this. It is the first thing I do when I ssh into my laptop.
I have to do it twice, though, until it works. In my `~/.bashrc` I have:
gpg-connect-agent updatestartuptty /bye
Right after logging in (auto login on Ubuntu / WSL 2), I get:
gpg-connect-agent: no running gpg-agent - starting
'/usr/bin/gpg-agent'
gpg-connect-agent: waiting for the agent to come up ... (5s)
gpg-connect-agent: connection to agent established
That looks good, but somehow it doesn’t work:
$ ssh some_server
sign_and_send_pubkey: signing failed for RSA "cardno:18 698 015"
from agent: agent refused operation
sign_and_send_pubkey: signing failed for RSA "(none)" from agent:
agent refused operation
felix at some_server: Permission denied (publickey).
After starting `tmux`, which runs `gpg-connect-agent` again, everything
works fine. I get the PIN entry dialog, and I can connect by SSH.
This is a non-issue, not really worth debugging. I start `tmux` every
time anyhow.
More information about the Gnupg-users
mailing list