This tutorial will teach you how to set up Sublime Text to edit files in ssh server.
Config Sublime
1. Open Sublime Text and hit “ctrl + `”. This will show console. Copy and paste the Python code from packagecontrol.io or as following
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)into the console terminal and hit enter.
2. Hit “ctrl + shift + p” to bring up the package manager. Search for "Install Package" and select it.
3. Check we are in installing package context and search and hit for rsub (a client to connect to the proxy app at ssh server). on succ, will print:
[rsub] Server running on localhost:52698
If already installed rsub, everytime Sublime starts, this message showed.
Installing ssh client
I suggest installing Xshell ( select English when decide language ).
Following is a saved login config:
Login to and config ssh server
Install rsub:
sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate sudo chmod a+x /usr/local/bin/rsub
Test
Consider you are in /var/www/html of your ssh server and want send file jsdo.html to Sublime:
sudo rsub jsdo.html
Use Sublime to edit this file and save, at ssh server, you will see the file changed after saved from Sublime.
No comments:
Post a Comment