Author Topic: Remote X session behind a firewall?  (Read 603 times)

MikeU

  • Newbie
  • *
  • Posts: 15
  • Kudos: 0
Remote X session behind a firewall?
« on: 29 October 2002, 12:32 »
Is this possible? If it is, which ports do I need to forward? Can anyone help me out on this?

Lets say my ISP gives me an IP address xxx.xxx.xxx.xxx, and my internal IP address is 10.0.0.3. And I'm trying to get MATLAB to plot. What should my DISPLAY env be?

Thanks for the help in advance.

Mike U

MikeU

  • Newbie
  • *
  • Posts: 15
  • Kudos: 0
Remote X session behind a firewall?
« Reply #1 on: 29 October 2002, 12:51 »
I guess I should have said firewall/router.
bah.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Remote X session behind a firewall?
« Reply #2 on: 29 October 2002, 14:08 »
First of all I am assuming you are running UNIX or Linux on both ends. If so I would use ssh if at all possible. Actually there are ways of using ssh forwarding even if you are running an X server on a Win client. This works very well and requires no firewall port forwarding. With X11 port forwarding to your firewall you are exposing yourself to security issues and you have less flexibility than you would have with ssh.

Make sure you have "X11Forwarding yes" in your "/etc/ssh/sshd_config" (don't forget to restart sshd if you have to change this setting). Then when you ssh in to your server from your client it should automatically set your DISPLAY variable to "localhost:10.0" (or thereabouts) and you can run any X app you please, ssh will do all the magic.

With ssh both client and server can be behind a firewall as long as you can get to the ssh port (udp/tcp port 22) on the server. If your server is behind a firewall you must have the firewall that the server is behind configured to forward udp/tcp port 22 to your server's private address so you can ssh into it (you'll then ssh into the public firewall address, not the private server address).

[ October 29, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

MikeU

  • Newbie
  • *
  • Posts: 15
  • Kudos: 0
Remote X session behind a firewall?
« Reply #3 on: 2 November 2002, 11:23 »
Thanks man. I got it to work. But, I just used -X hehehe. I was using -x and was wondering why it didn't work. Silly me.

ssh -X -l user hostname

worked great. Sorry to waste your time.

And I was using a FreeBSD machine behind an OpenBSD router.    

Damn, I really need to stop being so god damn vague. Really sorry about that, it irritates the shit out of me too. I just forget, when I'm the one being vague.

Mike U

[ November 02, 2002: Message edited by: MikeU ]


voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Remote X session behind a firewall?
« Reply #4 on: 2 November 2002, 11:27 »
Oh yes, forgot to mention you need the "-X" on some OSs. I don't need to add that switch in RedHat but I do with FreeBSD as you mentioned. Must be a difference in default compile options.
Someone please remove this account. Thanks...