Skip to content

Instantly share code, notes, and snippets.

@cstrahan
Forked from wm/pair.md
Created April 11, 2012 00:22
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cstrahan/2355907 to your computer and use it in GitHub Desktop.
Save cstrahan/2355907 to your computer and use it in GitHub Desktop.
TMUX Pairing

SSH setup for remote pairing

If Animal and Fozzie wanted to pair on Animals machine and they both have access to shared.muppets.com then they could use the following setup

  • Animal will have the following in ~/.ssh/config
Host tunnel_from_muppets
  Hostname space.muppets.com
  RemoteForward 1235 localhost:22
  User animal
  • Fozzie will have the following in ~/.ssh/config
Host tunnel_to_animals_via_muppets
  Hostname space.muppets.com
  LocalForward 9999 localhost:1235
  User fozzie
   
Host animals_via_muppets
  Hostname localhost
  User fozzie
  Port 9999
  • Animal creates an ssh tunnel to his machine via shared.muppets.com
ssh tunnel_from_muppets
  • Fozzie creates a tunnel to Animals tunnel on shared.muppets.com
ssh tunnel_to_animals_via_muppets
  • Fozzie in another shell can then ssh to Animal's machin as follows
ssh animals_via_muppets
@j3j3
Copy link

j3j3 commented May 16, 2012

What an amazing gist.

@aaronjensen
Copy link

An addition that we've found useful is to also forward the rails server to port 3100 on the client's machine:

Host animals_via_muppets
  Hostname localhost
  User fozzie
  Port 9999
  LocalForward 3100 localhost:3000

This may require you to edit /etc/sshd_config and set PermitTunnel yes (at least on OSX)

@mattfff
Copy link

mattfff commented Apr 8, 2013

Perfect. No need to open a port on the router, thus leaving my dev box open to attack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment