-
On the server side (in my case, Ubuntu) install rsub:
wget -O /usr/local/bin/rsub \https://raw.github.com/aurora/rmate/master/rmate chmod a+x /usr/local/bin/rsub
-
On the local side (again in my case macOS High Sierra 10.13.3) install rsub Sublime3 package. On Sublime Text 3, open Package Manager (Ctrl + Shift + P on Linux/Win, Cmd + Shift + P on Mac, Install Package), and search for rsub. Install it
-
Open command line and connect to remote server:
ssh -R 52698:localhost:52698 server_user@server_address -p portnumber
-
After connecting to the remote server, run this command:
rsub path_to_file/file.txt
Then file opening automatically in Sublime 3. Side Note: sublime must be already open before you go trough this.
Credit where its due, Stackoverflow