Edit remote files with Sublime Text over SSH (with sudo too!)
Install the rsub plugin for ST2/ST3, which is available through Package Control too.
Add a remote forwarding line under the right host in your
~/.ssh/config
file to enable connection:
Host myfancyvps
Hostname 123.45.67.89
RemoteForward 52698 127.0.0.1:52698
SSH in to your remote:
ssh myfancyvps
Download rmate:
curl https://raw.github.com/aurora/rmate/master/rmate > rmate
Move it in place:
sudo mv rmate /usr/local/bin
– you can put in ~/bin too if you only want to set it up for yourself, but sharing is caring :)Make it executable:
sudo chmod +x /usr/local/bin/rmate
Profit:
rmate .profile
– make sure you have an open ST2/ST3 window to enable listening!
More details on my blog: http://danieldemmel.me/blog/2012/09/02/setting-up-rmate-with-sublime-text-for-remote-file-editing-over-ssh/
Written by Daniel Demmel
Related protips
4 Responses
Thank you very much for this article.
Thanks for this article. For the interested, I wrote a small GUI on top of SSH called Secure Pipes (you can get it at http://www.opoet.com) to make setting up the tunnel a little easier and manageable (like auto reconnect, connect on start-up, etc). I will try to blog about using it with rmate and Sublime when I get a chance, but it works great.
_Tim
Does this work with ST3?
@anna: It should work with ST3, though I haven't had to use this for a while. Please let me know if it doesn't work though! :)