1

in ssh with

 ssh -CX user@remoteA

I can launch a xterm and see in my local desktop.

if I have a linux server (remoteA) without X server and a remote linux desktop (remoteB) with a X server.
If I connect with ssh to remoteB over remoteA

local -ssh-> remoteA -ssh-> remoteB

how I can launch a xterm in remoteB and see in local ?

JuanPablo
  • 913
  • 3
  • 10
  • 21

1 Answers1

2

You need to setup an end-to-end SSH connection, i.e. from local to remoteB, instead of chaining via remoteA. If you can't get to remoteB directly, either setup a port forward via remoteA, or use a ProxyCommand.

To use a port forward:

ssh -fNL 2222:remoteB:22 remoteA
ssh -Xp 2222 localhost

To use a ProxyCommand:

ssh -X -o "ProxyCommand=ssh remoteA nc %h %p" remoteB
mgorven
  • 30,615
  • 7
  • 79
  • 122