I was at home this holiday, with the family enjoying the Thanksgiving Holiday. Â I was messing around with stuff on my netbook and realized I wanted files from my desktop back in my apartment. Â Only problem was — I have no idea what my IP is back there (I moved recently). Â I’m also too lazy to setup my own or pay for a proper dyndns solution. Â Why is it that in 2010 I still have this kind’ve problem? Â Shouldn’t there be some application I can run on all my client pcs which keep them meshed together?
A bit of digging, couldn’t find anything. Â So I wrote one. Â Introducing the “Personal Cluster Manager for *nix/ssh systems”.
First, an important assumption: This software is meant to be used by you and you only. Â It probably won’t scale to 1000 machines and I’m perfectly fine with that. Â I have a handful (10?) machines I care about keeping track of for my stuff and I imagine most of the people who are interested in this are on the same order of magnitude.
Ok, enough nonsense, what is it? Â There are three pieces:
- A client daemon that maintains a reverse ssh tunnel with a master, always connected and accessible node. Â Theres a good bit of configuration to get this right, so theres also a little helper script to ask the user questions to get the right config values for the client.
- A “master” script. Â This provides Â an interface to a sqlite database which keeps track of what hosts we’ve seen, what ports their tunnels are on etc. Â You can ask the master “show me all hosts you know about” or “which tunnels are active and usable right now?”.
- A curses based UI. Â The UI pulls all its data from the master program, and doesn’t do any direct querying. Â (This is intentional, as I intend to build other kinds of UIs and want all the data stuff to be handled underneath the UI). Â The UI shows you what tunnels are active to which hosts, and with one keypress can give you a shell on any of the remote machines (using the reverse tunnel setup by the client).
All 3 of the above are working in version 0.1 in github.
A very poor quality screencast with typos and minor bugs left and right, but you’ll get the idea: (nevermind the ‘scrollz’ stuff, thats something particular about my local bashrc and nothing to do with PCM)