[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SSH connection failed to connect in eshell

From: Reza Housseini
Subject: Re: SSH connection failed to connect in eshell
Date: Wed, 23 Feb 2022 14:19:11 +0100

Thanks Michael for the analysis. I used this .ssh/config because tramp always prompted for the password on a public key connection. I just saw in the manual that one can force the connection to persist:

       "-o ControlPath=/tmp/ssh-ControlPath-%%r@%%h:%%p "
       "-o ControlMaster=auto -o ControlPersist=yes"))

would this be the appropriate setting for a gpg key? Is there any recommended way to use a gpg key with tramp? I don't think that my gpg key on the token isn't found, because the initial session always works without problems and also in the bash shell there is no issue using my gpg key as ssh key replacement.

Thanks again for your useful insights!


On Wed, Feb 23, 2022 at 1:00 PM Michael Albinus <> wrote:
Reza Housseini <> writes:

> Hello Michael

Hi Reza,

> I try to open a ssh connection to a remote host inside eshell. I'm
> using a gnupg key on a hardware token as my ssh key:
>     cd /ssh:root@
> All works fine until I invoke a command like lsusb, the following
> error appears:
>     Tramp failed to connect. If this happens repeatedly, try t 'M-x
> tramp-cleanup-this-connection'
> The backtrace in [1] was obtained with (setq tramp-verbose 10).
> My ~/.ssh/config looks like this:
>     Host *
>         IdentityFile /dev/null
>         PasswordAuthentication no
>         PubkeyAuthentication yes
> Hope you can make out an error on my side.

Thanks for your traces. As you have said, the primary connection works
w/o pain:

--8<---------------cut here---------------start------------->8---
10:40:55.919861 tramp-send-command (6) # exec ssh -l root   -e none
10:40:56.745065 tramp-process-actions (6) #
Last login: Wed Feb 23 08:43:22 2022 from
root@calendar ~#
--8<---------------cut here---------------end--------------->8---

However, when you call lsusb, a *new* connection is opened in eshell,
and this fails:

--8<---------------cut here---------------start------------->8---
10:44:11.444294 tramp-send-command (6) # exec ssh -l root   -e none
10:44:11.584717 tramp-process-actions (6) #
Load key "/dev/null": invalid format
root@ Permission denied (publickey,password).
--8<---------------cut here---------------end--------------->8---

Could it be, that, due to the GPG key, no parallel session is allowed?
Or that your GPG key on token is not found, and ssh uses the value of

Have you tried to enable tramp-use-ssh-controlmaster-options?

> Thanks and kind regards,
> Reza

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]