Connecting to ubuntu runnning rmate via multiple machines on the same network
Sebastian Wright
I've got an ubuntu server with rmate installed (that's a nice little package that lets you ssh to a server and edit remote files on your TextMate, locally).
The original setup claims it supports multiple machines accessing the same server, using the same port but different users. See the first link above.
For some reason when we ssh to two different users but on the same port from the same network, we're crossing paths. That means:
If two users exit - and , and a ssh-es via port 999 to server.com and b ssh-es via port 999 to server.com from the same network, if a writes rmate file on his terminal, b gets the file in his text editor in addition to a.
Hope this make sense - my networking game is not on point.
81 Answer
If you install and run rmate text locally, text will show in TextMate. This is because TextMate listens on localhost:52698 and rmate talks to localhost:52698 by default.
If you set TextMate>Preference>Terminal>Port to 52678, connect by ssh -R 52677:localhost:52678 and run rmate -p 52677 text remotely,
rmate will talk to localhost(of server.com):52677 which will then be tunneled to localhost(of your ssh client):52678 and text will show in TextMate.
For users from different hosts (eg. #1, #2), tunnel source port must be different, eg. [user1|user2] may keep TextMate port as is but connect with [52678|52679]:localhost:52698 and use rmate -p [52678|52679] respectively.
For users from the same host, both tunnel source and destination ports must be different among users, eg. [user1|user2] set TextMate port to [52678|52679], connect with [52678|52679]:localhost:[52678|52679] and use rmate -p [52678|52679] respectively.