Tunneling SubEthaEdit
Thanks to MacZOT, I have a free copy of SubEthaEdit coming my way. SubEthaEdit is an awesome editor for doing collaborative, realtime editing on a text document. That is, if you’re using a Mac. If you’re not, well you’ve got more serious problems.
Anyway, I was reading the blog at the Coding Monkey’s web site (the guys that make the editor) about how to run a SubEthaEdit server.
To forward SubEthaEdit traffic to a Mac OS X machine with Internet connection, we use redir. An example setup for redir would be “redir —lport 6942 —caddr <remoteipaddress> —cport 6942 -nredir —syslog”
That’s a great tip— and it helped me realize how I can use SubEthaEdit more often, even when working behind a firewall. In fact, two firewalls typically— my home router and the one running on OS X. To do this, we just need to use OpenSSH. Their ‘redir’ command translates to this SSH command (when run from your Mac’s terminal):
ssh user@server -g -R 6942:localhost:6942
And… that didn’t work. Well, after digging around a bit more, I realized that by default, SSH disables ‘-g’ (the gateway switch— allows public connections, not just local ones) when used in combination with ‘-R’ (forwarding a remote port to one on the local network). The option to enable it is (add to your server’s sshd_config file):
GatewayPorts yes
And with that, the ssh command works and I can share document URLs issued by SubEthaEdit (exchanging my machine name with my server’s name). This allows me to set up a document that I can share for editing/viewing to others on an as-needed basis. As a bonus, the sessions are secure since they’re run through SSH.
Leave a comment