njsmith / partiwm

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

xpra should handle different ssh ports #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It is currently not possible to specify an alternate ssh port when using 
xpra. The following is a diff of the latest Ubuntu version to add this 
functionality, so an ssh port can be specified like this: xpra attach 
ssh:hostname:ssh_port:x_port

--- xpra-orig/scripts/main.py   2010-04-26 23:57:35.820284434 -0400
+++ xpra/scripts/main.py    2010-04-26 23:47:56.760321991 -0400
@@ -115,8 +115,12 @@
 def client_sock(parser, opts, display_name):
     if display_name.startswith("ssh:"):
         sshspec = display_name[len("ssh:"):]
+        port = 22
         if ":" in sshspec:
-            (host, display) = sshspec.split(":", 1)
+            try:
+                (host, port, display) = sshspec.split(":", 2)
+            except:
+                (host, display) = sshspec.split(":", 1)
             display_args = [":" + display]
         else:
             host = sshspec
@@ -127,7 +131,7 @@
         else:
             remote_xpra = ["$HOME/.xpra/run-xpra"]

-        p = subprocess.Popen(["ssh", host, "-e", "none"]
+        p = subprocess.Popen(["ssh", host, "-e", "none", "-p", str(port)]
                              + remote_xpra + ["_proxy"] + display_args,
                              stdin=b.fileno(), stdout=b.fileno(),
                              bufsize=0)

Original issue reported on code.google.com by dan.brav...@gmail.com on 27 Apr 2010 at 4:00

GoogleCodeExporter commented 9 years ago
Thanks for the patch!

The development version supports this already in a different way -- use 'xpra 
attach --ssh="ssh -p 2222" ssh:my.host'. (The advantage of this method is that 
it allows you to modify arbitrary ssh options, not just the port.)

Original comment by njsmith@ucsd.edu on 26 Jun 2010 at 3:06

GoogleCodeExporter commented 9 years ago
I know this post is old, but I am trying the latest in the repo, and I get the 
error "xpra: error: no such option: --ssh". Is there a new method to do this, 
don't see it in the man page.

Original comment by chris.al...@gmail.com on 12 Oct 2011 at 2:08

azazar commented 7 years ago

--ssh argument doesn't work for changing port. The port number gets overridden by following arguments.

$ xpra start --ssh="ssh -p 2222" ssh:u@h:100 --start-child=xterm
2016-12-29 17:52:05,167 Xpra gtk2 client version 1.0-r14532 64-bit
2016-12-29 17:52:05,168  running on Linux Ubuntu 16.04 xenial
2016-12-29 17:52:06,587 GStreamer version 1.8.2 for Python 2.7.12 64-bit
2016-12-29 17:52:07,713 Warning: PyOpenGL version 3.1 or later is strongly recommended
2016-12-29 17:52:07,713  (found version 3.0.2)
2016-12-29 17:52:07,739 PyOpenGL warning: missing accelerate module
2016-12-29 17:52:07,739 PyOpenGL warning: missing array format handlers: numeric, vbo, vbooffset
2016-12-29 17:52:07,739 OpenGL Version: 3.3.0 NVIDIA 340.98
2016-12-29 17:52:07,762 OpenGL enabled with GeForce GT 240/PCIe/SSE2
2016-12-29 17:52:07,872  keyboard settings: rules=evdev, model=pc105, layout=us,ru
2016-12-29 17:52:07,875  desktop size is 1280x1024 with 1 screen:
2016-12-29 17:52:07,875   :0.0 (339x271 mm - DPI: 95x95) workarea: 1280x993
2016-12-29 17:52:07,875     monitor 1 (338x270 mm - DPI: 96x96)
2016-12-29 17:52:08,170 keyboard layouts: us,ru,us,ru
u@h's password: 

got signal SIGINT, exiting
2016-12-29 17:52:24,175 The SSH process has terminated with exit code -2
2016-12-29 17:52:24,177  the command line used was:
2016-12-29 17:52:24,178  ssh -p 2222 -l u -p 22 -T h sh -c 'xpra initenv;~/.xpra/run-xpra _proxy_start :100 "--start-child=xterm" || $XDG_RUNTIME_DIR/xpra/run-xpra _proxy_start :100 "--start-child=xterm" || xpra _proxy_start :100 "--start-child=xterm"'

Used SSH command was ssh -p 2222 -l u -p 22 -T h

njsmith commented 7 years ago

See the note at the top of: https://github.com/njsmith/partiwm/blob/master/README

The code you're using is from xpra.org, and you should file a bug report with them.

On Dec 29, 2016 04:53, "azazar" notifications@github.com wrote:

--ssh argument doesn't work for changing port. The port number gets overridden by futher arguments.

$ xpra start --ssh="ssh -p 2222" ssh:u@h:100 --start-child=xterm 2016-12-29 17:52:05,167 Xpra gtk2 client version 1.0-r14532 64-bit 2016-12-29 17:52:05,168 running on Linux Ubuntu 16.04 xenial 2016-12-29 17:52:06,587 GStreamer version 1.8.2 for Python 2.7.12 64-bit 2016-12-29 17:52:07,713 Warning: PyOpenGL version 3.1 or later is strongly recommended 2016-12-29 17:52:07,713 (found version 3.0.2) 2016-12-29 17:52:07,739 PyOpenGL warning: missing accelerate module 2016-12-29 17:52:07,739 PyOpenGL warning: missing array format handlers: numeric, vbo, vbooffset 2016-12-29 17:52:07,739 OpenGL Version: 3.3.0 NVIDIA 340.98 2016-12-29 17:52:07,762 OpenGL enabled with GeForce GT 240/PCIe/SSE2 2016-12-29 17:52:07,872 keyboard settings: rules=evdev, model=pc105, layout=us,ru 2016-12-29 17:52:07,875 desktop size is 1280x1024 with 1 screen: 2016-12-29 17:52:07,875 :0.0 (339x271 mm - DPI: 95x95) workarea: 1280x993 2016-12-29 17:52:07,875 monitor 1 (338x270 mm - DPI: 96x96) 2016-12-29 17:52:08,170 keyboard layouts: us,ru,us,ru u@h's password:

got signal SIGINT, exiting 2016-12-29 17:52:24,175 The SSH process has terminated with exit code -2 2016-12-29 17:52:24,177 the command line used was: 2016-12-29 17:52:24,178 ssh -p 2222 -l u -p 22 -T h sh -c 'xpra initenv;~/.xpra/run-xpra _proxy_start :100 "--start-child=xterm" || $XDG_RUNTIME_DIR/xpra/run-xpra _proxy_start :100 "--start-child=xterm" || xpra _proxy_start :100 "--start-child=xterm"'

Connection command was ssh -p 2222 -l u -p 22

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/njsmith/partiwm/issues/25#issuecomment-269626406, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlOaBY0coD9SmdMBbSWhI7lRd-4_c1Sks5rM61KgaJpZM4LXkDd .