To install the rsub package on Sublime:

  • Open Sublime
  • Goto Tools -> Install Package Control
  • Go to Preferences -> Package Control (ctrl + shift + p on Windows; cmd + shift + p on OS X)
  • Type Package Control: Install Package and hit Enter
  • Search for rsub and hit Enter

Open your CLI / Terminal, and create (if you don't have one) and edit the config file in the .ssh folder:

nano ~/.ssh/config

Enter your server details. For example, if you were trying to log in to an AWS EC2 instance, where your Public DNS was, and your private was located at ~/.ssh/my_aws.pem, you would want to write the following:

Host aws
User ec2-user
IdentityFile ~/.ssh/my_aws.pem
RemoteForward 52698

Host awsHostname ec2-userIdentityFile ~/.ssh/my_aws.pemRemoteForward 52698

Installing rmate on Your Remote Server

Now log in to your remote server and run the following command, in order to install rsub’s best friend, rmate

sudo wget -O /usr/local/bin/rsub 
chmod +x /usr/local/bin/rsub

Now, rsub and rmate can talk to each other through the tunnel. Try it out!

/var/www/html/# rsub index.php