Working on a server behind a firewall (with OS X)

Peter Rukavina

I have several clients who have intranet applications running on servers that live behind a firewall. General there are firewall rules in place that allow me to access these servers via SSH (over port 22). But I need a way of using a web browser to test applications I’m developing on these servers.

Here’s a brief explanation of two ways I can do this, using Mac OS X on my end, and Linux on the remote end.

First, and easiest, is to use Apple’s new X11 server beta to use a browser running on the remote machine. To do this, I simply start up an X11 terminal client, use SSH to connect to the remote server, and then run Mozilla. To do this requires that X11 Forwarding be enabled on both the client and the server. On the OS X end, you need to uncomment the line ForwardX11 yes in the file /etc/ssh_config. On the remote end, make sure that the line X11Forwarding yes is uncommented in the file that’s probably located at sshd_config. Running Mozilla over a remote connection isn’t as fast or responsive as running a local browser, but it’s much snappier than I expected.

The second method is to use SSH port-forwarding and a local browser. Let’s say your remote host, behind the firewall, is called remotehost.com, it’s running a server on port 80, and your account on the remote machine is called myaccount. To port-foward on your OS X machine, simply call up a Terminal session and enter ssh -l myaccount -L 8080:remotehost.com:80 remotehost.com. Now you can call up a local browser, and browser to address localhost:8080. and you’ll be surfing the remote website.

Comments

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search