How to Edit Remote Files With Sublime via an SSH Tunnel

This method just found online is amazing, and easy to follow. 
  1. As of writing, these instructions work only for Sublime Text 2.  If I get a chance I’ll look into forking rsub for the newly released ST3 (which runs Python3).
  2. If you don’t already have Sublime Text’s wonderful package manager, install it.
  3. Hit Ctrl+Shift+P, start typing “install” and select “Install Package”
  4. Start typing “rsub” and select it.
  5. Once it’s installed, get on your terminal and do
    nano ~/.ssh/config
  6. Paste the following lines:
    Host your_remote_server.com
        RemoteForward 52698 127.0.0.1:52698
  7. Save (ctrl+w) and SSH into your server (ssh username@your_remote_server.com).
  8. ‘Install’ the rsub remote script:
    sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate
  9. Make that script executable:
    sudo chmod +x /usr/local/bin/rsub
  10. Lastly, run rsub on the remote file you want to edit locally:
    rsub ~/my_project/my_file.html
    and it should magically open in Sublime Text!

0 comments

Popular Posts

无觅相关文章插件,迅速提升网站流量