Re: SSH Tunneling of X protocol from non-interactive session

From: Mihai Osian (zzz_at_zzz.com)
Date: 10/12/05


Date: Wed, 12 Oct 2005 14:34:29 +0200

Dobes Jiri wrote:

> Mihai Osian wrote:
>
>> Mihai Osian wrote:
>>
>>> Dobes Jiri wrote:
>>>
>>>> Hallo,
>>>>
>>>> I need to forward X terminal through the firewall from
>>>> non-interactive session.
>>>>
>>>>
>>>> Situation:
>>>> M - my computer
>>>> F - firewall
>>>> C - cluster with application
>>>>
>>>> M --- F ---- C
>>>>
>>>> The final point is to run a X application on C from a queuing
>>>> system and display on M.
>>>>
>>>> First setup simple test. I am sitting at M. I would like to open
>>>> tunnel from C to M tunneling X protocol.
>>>>
>>>> M> xhost +
>>>> M> ssh -x C
>>>> C> ssh -L6001:localhost:6000 M
>>>>
>>>> Now I try to run application on C and forward the X protocol to M.
>>>> Open another termimal (still leaving the tunnel opened) and
>>>>
>>>> M> ssh -x C
>>>> C> export DISPLAY=C:1
>>>> C> xterm
>>>>
>>>> and error message appear:
>>>> xterm Xt error: Can't open display: C:1
>>>>
>>>> Does anybody know why? Is there a problem with authorization? On M
>>>> all the connections are allowed (it was xhost +).
>>>>
>>>> If this would work I would write a script creating tunnel from C to
>>>> M and running the application on C with display C:1 forwarded to M.
>>>> When the script is executed terminal would open on my desktop...
>>>>
>>>>
>>>> Thanks for all the help!!!
>>>>
>>>>
>>>>
>>>> Jiri
>>>>
>>>>
>>>> P.S.: I use OpenSSH_3.7.1p2, however I don't think it is important...
>>>>
>>>
>>> First remark: why exactly do you want to forward the X connection
>>> manually instead of letting ssh do the dirty work (M>ssh -Y C) ?
>>
>
>
> I cannot use -X or -Y option, because I have to run
> *noninteractivelly* from computer C to display M. I plan to sumbmit
> script like
>
> export DISPLAY=C:1
> xterm -e gdb my_executable
>
> while there is a open tunnel from C:6001 to M:6000.
>
> It is because C is a 50 nodes cluster and I need to run debuging job
> in a parallel enviroment. I don't sit on front of the C, but at
> terminal M, it is 1000 km away [700 miles]. Normally, you have to
> prepare script on C, submit the script using PBS system and when the
> cluster is free [usually imediatelly] the job starts. When the job
> starts, I would like it to open terminal with the debugger on my
> computer M and I can start to debug interactivelly. I was doing that,
> but there is a firewall now and I don't know how to work it out.
>
> >> Second: Are you sure that X is listening on localhost:6000 on M ? It
> >> might be possible that the X server was launched with the -nolisten
> flag.
>
> It should be listening. The X is running with
> /usr/X11R6/bin/X vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-qCOhba
> I can go to another machine, point display to M:0.0 and open a
> terminal. How can I recognise on which port does it listen (it should
> be 6000 normally). netstat -a gives me this line:
> tcp 0 0 *:x11 *:* LISTEN
>
> Any idea?
>
> Jiri

  Humm... One question, regarding the following line:
C> export DISPLAY=C:1
  "C:1" might refer to C's external IP address, while the ssh tunnel is
made to the loopback address (localhost:6000 on C). Once the tunnel is
setup, can you run "telnet localhost:60001" on C and get a successful
connection ? If you can not, then try this:
C> export DISPLAY=localhost:1
 and see what happens.

Mihai



Relevant Pages

  • Re: SSH Tunneling of X protocol from non-interactive session
    ... > in a parallel enviroment. ... > prepare script on C, submit the script using PBS system and when the ... > It should be listening. ... "C:1" might refer to C's external IP address, while the ssh tunnel is ...
    (comp.os.linux.x)
  • Re: SSH Tunneling of X protocol from non-interactive session
    ... > in a parallel enviroment. ... > prepare script on C, submit the script using PBS system and when the ... > It should be listening. ... "C:1" might refer to C's external IP address, while the ssh tunnel is ...
    (comp.os.linux.misc)
  • Re: SSH Tunneling of X protocol from non-interactive session
    ... > in a parallel enviroment. ... > prepare script on C, submit the script using PBS system and when the ... > It should be listening. ... "C:1" might refer to C's external IP address, while the ssh tunnel is ...
    (comp.os.linux)
  • Re: assigning multiple ip addresses to NIC on bootupm, how?
    ... rc.local is the last script run and ... he doesnt need the logical interfaces active before httpd runs ... "Listen" options in httpd.conf - which means that Apache is listening on ... [root@tregonwell root]# ifconfig eth0:1 192.168.0.140 ...
    (Fedora)
  • Re: Britishisms
    ... That is, I'm listening to each series in the normal order, but ... series by series in reverse order, ... Graeme Garden wanted to get paid for a radio programme without all that tedious script writing which took weeks of effort. ... Do you want a copy of the Christmas 2007 special, "Humph in Wonderland"? ...
    (alt.usage.english)

Quantcast