It is quite possible that you already have some other options set. To do this, open your SSH config and we will specify that for all hosts (alternatively you can specify that for individual hosts as well), this host forwarding should work. And this is how you do it: ssh -R 52698:localhost:52698 since that is super annoying, we can automate the whole thing. Normally you have to create the appropriate port forwarding for each SSH connection. The next and last thing we need to do is to set up the port forwarding. mv /usr/local/bin/rmate /usr/local/bin/subl I usually rename it to subl - just like I have it locally. sudo chmod +x /usr/local/bin/rmateĪlternatively, you can rename it. I will show you how this works below.īut now rmate must be installed on the remote server. The easiest way to do this is to use a reverse SSH tunnel. Rmate is installed on the server and connects back to your computer so that it can communicate directly with Sublime. Installation of rmate on the remote server This plugin can be easily installed via PackageControl. We use a plugin called RemoteSubl locally for Sublime, which brings rmate to Sublime. Installation of RemoteSubl on the local computer
That's why I'll show you today how to open and edit remote files comfortably with Sublime directly from the terminal. To edit the file, just start typing your changes. If the specified file does not exist, Nano creates it. Replace filename with the name of the file that you want to edit. To open a file in Nano, type the following command at the command line: nano filename. But what I feel comfortable with is Sublime. Editing files with the Nano text editor is easy. A good read: Raspberry Pi Documentation - Text editors. To edit a file you can choose between many editors. For details please read the manpage: man cat. Of course this works only if the file is readable for your user account. Personally, I am not a fan of these editors, because I just don't feel comfortable with them. To view the text file you could use less or cat. It does not matter whether you work with vim, nano, or pico. Editing files on a remote server via SSH can be tedious and annoying.