GNU bug report logs -
#54950
Connecting to remote guix daemon with encrypted SSH key fails
Previous Next
To reply to this bug, email your comments to 54950 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#54950
; Package
guix
.
(Fri, 15 Apr 2022 11:10:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Arun Isaac <arunisaac <at> systemreboot.net>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Fri, 15 Apr 2022 11:10:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I have an SSH key encrypted with a passphrase. When I try connecting to
a remote guix daemon with that encrypted SSH key, it fails with the
following error message.
--8<---------------cut here---------------start------------->8---
$ GUIX_DAEMON_SOCKET=ssh://foo guix build -v3 hello
guix build: error: SSH authentication failed for 'foo': Access
denied for 'publickey'. Authentication that can continue: publickey
--8<---------------cut here---------------end--------------->8---
I expected some kind of prompt asking me for the passphrase, but did not
get any. The same command works if I set up ssh-agent and add the
relevant key to it.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#54950
; Package
guix
.
(Wed, 08 Jun 2022 20:31:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 54950 <at> debbugs.gnu.org (full text, mbox):
Hi,
Arun Isaac <arunisaac <at> systemreboot.net> writes:
> I have an SSH key encrypted with a passphrase. When I try connecting to
> a remote guix daemon with that encrypted SSH key, it fails with the
> following error message.
>
> $ GUIX_DAEMON_SOCKET=ssh://foo guix build -v3 hello
> guix build: error: SSH authentication failed for 'foo': Access
> denied for 'publickey'. Authentication that can continue: publickey
>
> I expected some kind of prompt asking me for the passphrase, but did not
> get any. The same command works if I set up ssh-agent and add the
> relevant key to it.
I suspect this is due to changes in OpenSSH *client* that now refuse
older RSA keys for security reasons.
Could you retry with the following option: 'StrictHostKeyChecking no'
applied to the host in your ~/.ssh/config?
If that's indeed the problem, you'll want to upgrade your key to
something more modern like ed25519.
I hope that helps,
Maxim
Information forwarded
to
bug-guix <at> gnu.org
:
bug#54950
; Package
guix
.
(Wed, 15 Jun 2022 06:31:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 54950 <at> debbugs.gnu.org (full text, mbox):
Hi Maxim,
> I suspect this is due to changes in OpenSSH *client* that now refuse
> older RSA keys for security reasons.
This doesn't seem to be. Here's why: I have another machine that I ssh
to using an unencrypted RSA key. I am able to connect to the Guix daemon
on that machine without any trouble. What's more, the machine with an
encrypted key, whose Guix daemon I'm unable to connect to, uses an ECDSA
key.
> Could you retry with the following option: 'StrictHostKeyChecking no'
> applied to the host in your ~/.ssh/config?
Adding 'StrictHostKeyChecking no' makes no difference. The unencrypted
key still works, and the encrypted doesn't.
Cheers!
Arun
Information forwarded
to
bug-guix <at> gnu.org
:
bug#54950
; Package
guix
.
(Wed, 15 Jun 2022 15:47:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 54950 <at> debbugs.gnu.org (full text, mbox):
Hi Arun,
Arun Isaac <arunisaac <at> systemreboot.net> writes:
> Hi Maxim,
>
>> I suspect this is due to changes in OpenSSH *client* that now refuse
>> older RSA keys for security reasons.
>
> This doesn't seem to be. Here's why: I have another machine that I ssh
> to using an unencrypted RSA key. I am able to connect to the Guix daemon
> on that machine without any trouble. What's more, the machine with an
> encrypted key, whose Guix daemon I'm unable to connect to, uses an ECDSA
> key.
>
>> Could you retry with the following option: 'StrictHostKeyChecking no'
>> applied to the host in your ~/.ssh/config?
>
> Adding 'StrictHostKeyChecking no' makes no difference. The unencrypted
> key still works, and the encrypted doesn't.
Thanks for checking. Other things to try:
Kill pinentry, which is potentially waiting for the passphrase on the
wrong X11 display or tty, for example if you accessed the machine via
SSH:
killall pinentry
I don't know which ssh agent you use; I use the 'gpg-agent' provided by
GnuPG. info '(gnupg) Common Problems' has this:
* SSH hangs while a popping up pinentry was expected
SSH has no way to tell the gpg-agent what terminal or X display it
is running on. So when remotely logging into a box where a
gpg-agent with SSH support is running, the pinentry will get popped
up on whatever display the gpg-agent has been started. To solve
this problem you may issue the command
echo UPDATESTARTUPTTY | gpg-connect-agent
and the next pinentry will pop up on your display or screen.
However, you need to kill the running pinentry first because only
one pinentry may be running at once. If you plan to use ssh on a
new display you should issue the above command before invoking ssh
or any other service making use of ssh.
It seems this gotcha would also apply to other SSH agents. I've had
this problem in the past, when SSH'in to a remote machine that had a
graphical session running, and killing the running pinentry and issuing
the above 'echo UPDATESTARTUPTTY | gpg-connect-agent' command did the
trick.
Let me know if this helps.
Maxim
Information forwarded
to
bug-guix <at> gnu.org
:
bug#54950
; Package
guix
.
(Thu, 16 Jun 2022 06:35:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 54950 <at> debbugs.gnu.org (full text, mbox):
Hi Maxim,
I normally use neither OpenSSH's ssh-agent nor gpg-agent's ssh-agent
feature. But, when I do, it works. I didn't run into any pinentry issues
like you described. But, that's only because a passphrase entry is not
required at the time of `guix build'. Passphrase entry is required only
at the time of `ssh-add' when I am adding the key to the ssh-agent. Just
to be clear, here are the exact steps I used to set up gpg-agent.
Enable gpg's ssh-agent feature
$ echo use-agent >> ~/.gnupg/gpg.conf
$ echo enable-ssh-support >> ~/.gnupg/gpg-agent.conf
pkill and restart gpg-agent (command not shown). Then, add the key to
gpg's ssh-agent. A passphrase is prompted at this point.
$ ssh-add ~/.ssh/id_ecdsa
guix build with remote daemon. A passphrase is not prompted at this
point because it was already added into the ssh-agent in the last step.
$ SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh
GUIX_DAEMON_SOCKET=ssh://foo guix build -v3 hello
So, with an ssh-agent, guix build on a remote daemon works. But, I'd
like it to work without an ssh-agent. Is that possible?
Regards,
Arun
Information forwarded
to
bug-guix <at> gnu.org
:
bug#54950
; Package
guix
.
(Thu, 16 Jun 2022 14:02:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 54950 <at> debbugs.gnu.org (full text, mbox):
Hello Arun,
Arun Isaac <arunisaac <at> systemreboot.net> writes:
> So, with an ssh-agent, guix build on a remote daemon works. But, I'd
> like it to work without an ssh-agent. Is that possible?
I've re-read the original issue and now I have a better understanding of
it; the manual mentions GUIX_DAEMON_SOCKET is handled via the Guile-SSH
library. I'm curious as to how SSH clients typically trigger 'pinentry'
to prompt; perhaps Guile-SSH is lacking some feature here.
I hope someone in the know can tip in! In the meantime, you've already
found a workaround (the use of an SSH agent).
Thanks,
Maxim
Information forwarded
to
bug-guix <at> gnu.org
:
bug#54950
; Package
guix
.
(Fri, 17 Jun 2022 06:53:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 54950 <at> debbugs.gnu.org (full text, mbox):
Hi Maxim,
> I'm curious as to how SSH clients typically trigger 'pinentry' to
> prompt; perhaps Guile-SSH is lacking some feature here.
Exactly my point! :-)
> I hope someone in the know can tip in! In the meantime, you've already
> found a workaround (the use of an SSH agent).
Yup.
Thanks,
Arun
This bug report was last modified 2 years and 364 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.