TRAMP cannot connect to remote + proxyjump

Rishub Nagpal <[email protected]> Sat, 17 Jan 2026 13:51:31 +0100
Newsgroups gmane.emacs.tramp
Message-ID <CALCyNycv_3nNhpvV+YYtZgUZ52QETgQ88GjbKva9F+9ue7mTPw@mail.gmail.com>
--0000000000007ce414064894eb2e
Content-Type: text/plain; charset="UTF-8"

Dear tramp-devel,

I am trying to connect to a remote that is behind a proxyjump in my SSH
config. It is described as follows:

Host host2
  SetEnv TERM=xterm-256color
  HostName host2
  ProxyJump rnagpal@host1
  User rnagpal
  LocalForward 8888 localhost:8888

Host host1
  HostName host1
  User rnagpal
  LocalForward 8888 localhost:8888

With a terminal, I am able to ssh without issue via `ssh host2` however I
cannot do it with TRAMP async-shell-command nor eshell. However, I can do
it via term from within emacs. Furthermore it works by piping `/ssh:host1 |
/ssh:host2`

But just using `/ssh:host2`
I get the following error:
```
bash: No such file or directory
Connection closed by UNKNOWN port 65535
```
TRAMP log with verbose level 7:
```
13:37:02.964746 tramp-maybe-open-connection (6) # /bin/sh -i
13:37:02.965207 tramp-wait-for-regexp (6) #
#$
13:37:02.965319 tramp-maybe-open-connection (3) # Opening connection for
host2 using ssh...
13:37:02.965367 tramp-send-command (6) # exec ssh -o ControlMaster=auto -o
ControlPath=/home/rishub/.cache/emacs/tramp.%C -o ControlPersist=no -e none
host2 || exit
13:37:02.965400 tramp-process-actions (3) # Waiting for prompts from remote
shell...
13:37:02.966720 tramp-process-one-action (5) # Looking for regexp
"\(.*\(?:login\|user\)\(?:[[:blank:]].*\)?:[[:blank:]]*\)\'" from remote
shell
```

I thought the issue may be related to:
https://emacs.stackexchange.com/questions/24159/tramp-waiting-for-prompts-from-remote-shell
However after removing my .bashrc and .profile on both hosts the issue
still persists.

Any ideas on what to do?
Rishub

--0000000000007ce414064894eb2e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div id=3D"gmail-:tl" class=3D"gmail-Am gmail-aiL gmail-Al=
 editable gmail-LW-avf gmail-tS-tW gmail-tS-tY" aria-label=3D"Message Body"=
 role=3D"textbox" aria-multiline=3D"true" style=3D"direction:ltr;min-height=
:828px" tabindex=3D"1" aria-controls=3D":wm" aria-expanded=3D"false">Dear t=
ramp-devel,<br><br>I am trying to connect to a remote that is behind a prox=
yjump in my SSH config. It is described as follows:<br><br>Host host2<br>=
=C2=A0 SetEnv TERM=3Dxterm-256color<br>=C2=A0 HostName host2<br>=C2=A0 Prox=
yJump rnagpal@host1<br>=C2=A0 User rnagpal<br>=C2=A0 LocalForward 8888 loca=
lhost:8888<br><br>Host host1<br>=C2=A0 HostName host1<br>=C2=A0 User rnagpa=
l<br>=C2=A0 LocalForward 8888 localhost:8888<br><br><div>With a terminal, I=
 am able to ssh without issue via `ssh host2` however I cannot do it with T=
RAMP async-shell-command nor eshell. However, I can do it via term from wit=
hin emacs. Furthermore=C2=A0it works by piping `/ssh:host1 | /ssh:host2`=C2=
=A0</div><div><br></div><div>But just using `/ssh:host2`</div><div>I get th=
e following error:</div>```<br>bash: No such file or directory<br>Connectio=
n closed by UNKNOWN port 65535<br>```<br>TRAMP log with verbose level 7:<br=
>```<br>13:37:02.964746 tramp-maybe-open-connection (6) # /bin/sh -i<br>13:=
37:02.965207 tramp-wait-for-regexp (6) #<br>#$<br>13:37:02.965319 tramp-may=
be-open-connection (3) # Opening connection for host2 using ssh...<br>13:37=
:02.965367 tramp-send-command (6) # exec ssh -o ControlMaster=3Dauto -o Con=
trolPath=3D/home/rishub/.cache/emacs/tramp.%C -o ControlPersist=3Dno -e non=
e host2 || exit<br>13:37:02.965400 tramp-process-actions (3) # Waiting for =
prompts from remote shell...<br>13:37:02.966720 tramp-process-one-action (5=
) # Looking for regexp &quot;\(.*\(?:login\|user\)\(?:[[:blank:]].*\)?:[[:b=
lank:]]*\)\&#39;&quot; from remote shell<br>```<br><br><div>I thought the i=
ssue may be related to:<a href=3D"https://emacs.stackexchange.com/questions=
/24159/tramp-waiting-for-prompts-from-remote-shell">https://emacs.stackexch=
ange.com/questions/24159/tramp-waiting-for-prompts-from-remote-shell</a><sp=
an class=3D"sewrnzv2ld6cqcp"></span><span class=3D"sewrnzv2ld6cqcp"></span>=
</div><div>However after removing my .bashrc and .profile on both hosts the=
 issue still persists.</div><div><br></div><div>Any ideas on what to do?</d=
iv><div>Rishub</div></div><br></div>

--0000000000007ce414064894eb2e--