1

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 - a@server.com and b@server.com, 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.

8
  • Are you using a configuration as explained in the article mate and rmate, section "Port Forwarding" at the end?
    – harrymc
    May 9 '18 at 20:13
  • I am. Something specific there that you think I might be missing?
    – Tom Granot
    May 9 '18 at 20:15
  • Yeah it was the textmate port thing - mussed that! I think I approved the bounty as well, no?
    – Tom Granot
    May 11 '18 at 5:02
  • Works on my mac, but I'll wait for my partners to connect on windows and let you know we're not crossong wires. Thanks for taking the time, tho. ;)
    – Tom Granot
    May 11 '18 at 5:33
  • If you could specify steps for sublime on windows, actually, that would really help my partners.
    – Tom Granot
    May 11 '18 at 5:34
4
+50

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 user@server.com 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.

3
  • This answer is based on testing with Sublime Text 2 + rsub on Windows & rmate-bash hosted on Ubuntu desktop. Feel free to ask if there is anything unclear, as I afraid my explanation is inadequate.
    – guest-vm
    May 11 '18 at 5:08
  • Can you clarify the last part? Why is it different?
    – Tom Granot
    May 11 '18 at 7:47
  • To ensure that the ssh tunnel <src ip, src port, dest ip, dest port> is unique. users from different hosts have different "dest ip", so "dest port" can be the same. users from the same host have same "dest ip", so "dest port" should be different.
    – guest-vm
    May 11 '18 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.