njsmith / partiwm

[defunct] Experiments with window managers in Python + GTK+, including the original version of xpra
GNU General Public License v2.0
23 stars 3 forks source link

add syntactic sugar to "ssh:" scheme for bouncing through multiple hosts #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to attach to an internal server, which is only reachable via an outer 
one.

I've tried the following, but it did not work:
% xpra attach ssh:outer:inner:7
Attached (press Control-C to detach)
zsh: no such file or directory: /home/user/.xpra/run-xpra
Connection lost

Is there a way to get this working?
Otherwise I suggest xpra should connect to the next host, until it finds a port 
number or something similar.

Original issue reported on code.google.com by dhahler@gmail.com on 31 Jul 2010 at 6:18

GoogleCodeExporter commented 9 years ago
I found out that I can use the "--ssh" argument for this:
% xpra --ssh 'ssh outer ssh' attach ssh:inner:7

It would be useful though, if xpra would transform this automatically out of 
"outer:inner".

Original comment by dhahler@gmail.com on 31 Jul 2010 at 7:00

GoogleCodeExporter commented 9 years ago
Right, that's the workaround I would have suggested :-) But I imagine that this 
comes up relatively often, so that's a good idea to provide a nice syntax.

(Also, FYI, depending on your setup, you might want to consider just running 
xpra on 'outer', and then using X forwarding from 'inner' to 'outer' -- that's 
what I do when running stuff on our compute cluster, that has one 'bastion' 
host where I run screen+xpra and then a bunch of hosts with fast network 
connections that I can ssh onwards to.)

Original comment by njsmith@ucsd.edu on 31 Jul 2010 at 9:14

GoogleCodeExporter commented 9 years ago

Original comment by njsmith@ucsd.edu on 31 Jul 2010 at 9:14

GoogleCodeExporter commented 9 years ago
I guess you could also do (--ssh is a 'new' flag, so this is required for older 
version):
xpra --remote-xpra 'ssh inner .xpra/run-xpra' attach ssh:outer:7

and/or setup a .ssh/config entry for inner that sets ProxyCommand "ssh outer -W 
%h"

Original comment by norm...@google.com on 4 May 2011 at 10:22

GoogleCodeExporter commented 9 years ago
Like suggested in comment #4, this functionality can be achieved with 
ProxyCommand option for openssh.

Let say you're able to connect to host outer.host.example.com with public key 
authentication and from there to inner.host.example.com also with public key 
authentication (key is loaded in ssh-agent and agent connection is forwarded).

Then by configuring following entry in $HOME/.ssh/config ...

host outer-inner 
                hostname inner.host.example.com
                compression yes
                protocol 2
                ProxyCommand ssh outer.host.example.com "/bin/nc %h %p"
                ForwardAgent yes

... will allow you to ssh to inner host in one step ...

  ssh outer-inner

... or use xpra from your client as ...

  xpra attach ssh:outer-inner:DISPLAY_NUMBER

It works perfectly for me.

Original comment by martin.r...@gmail.com on 28 Dec 2011 at 11:04