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 ec2-12-149-113-102.eu-west-1.compute.amazonaws.com, and your private was located at ~/.ssh/my_aws.pem, you would want to write the following:

Host aws
Hostname ec2-12-149-113-192.eu-west-1.compute.amazonaws.com
User ec2-user
IdentityFile ~/.ssh/my_aws.pem
RemoteForward 52698 127.0.0.1:52698

Host awsHostname ec2-12-123-123-12.eu-west-1.compute.amazonaws.comUser ec2-userIdentityFile ~/.ssh/my_aws.pemRemoteForward 52698 127.0.0.1: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 https://raw.githubusercontent.com/geekism/rmate/master/rmate 
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