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
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/101995/e86681e49622d52817b36fd2a4c936b7.jpeg)
Thank you very much for this article.
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/114251/07sCiRmw_normal.png)
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
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/138506/cropped-10703753_285581281631050_4022404497910871023_n1-e1441872456909.jpg)
Does this work with ST3?
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/19151/f7aadd9c3f091c013076441ee87adcbf.png)
@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! :)