The following steps facilitate remote pairing using:
- tmux which allows terminal sessions to be attached to different terminals, and
- ngrok which provides secure tunnels to your localhost
OS X: brew install tmux
Linux: sudo apt-get install tmux
- Sign up to ngrok.gom
- Follow instructions on ngrok site to install and download.
- Specify your authtoken to ngrok
Note: You can skip this step if you are just connecting to a colleague's tmux session.
To establish a secure SSH tunnel and allow port forwarding via ngrok:
ngrok tcp 22
Note: You can skip this step if you are just connecting to a colleague's tmux session.
If you haven't already:
gem install github-auth
Assuming you want to authorise GitHub user tcuser2 to a tmux session called tc which has already been established:
gh-auth add --users="tcuser2" --command="$(which tmux) attach -t tc"
This will ensure that user tcuser2 can use tmux to attach to session tc.
Assuming your GitHub userid is tcuser1 and your ngrok TCP session is using port 12345, you will need to tell your colleague tcuser2 to connect using:
ssh -p 12345 [email protected]
Provided prerequisite steps 1 and 2 have been followed, the secure SSH tunnel has been established via ngrok and tcuser1 has used gh-auth to authorise tcuser2 to attach to tmux session tc, user tcuser2 will be then attached to the tmux session running on tcuser1's machine.
- http://iamvery.com/2013/11/16/tmux-pairing-anywhere-on-your-box.html
- http://bizzark.com/2014/04/17/pair-programming-with-tmux-and-ngrok.html
- https://developer.atlassian.com/blog/2015/05/secure-localhost-tunnels-with-ngrok/
- https://ngrok.com/docs
- https://github.com/inconshreveable/ngrok
- https://inconshreveable.com/09-25-2013/ngrok-tunnels-better-faster-stronger/
- Video: The Making of ngrok
- Video: The What and Why of ngrok
- How to run your own ngrokd server