Skip to content
dickgroenenberg edited this page Oct 13, 2022 · 3 revisions

Use TextMate to edit remote files

This method makes use of SSH tunneling.
On the remote server install a version of rmate.
If you don't have Ruby installed (or don't want to)
you can install a Bash version of rmate:

sudo wget -O /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
sudo chmod a+x /usr/local/bin/rmate

In the Terminal-tab of TextMate's preference-pane, make sure
"Accept rmate connections" is checked; "Acces for" is set
to local clients and the Port is 52698. Log in using:

ssh -i keyfile.pem -R 52698:localhost:52698 ubuntu@123.456.789.000

From within the ssh session you can now simply edit the
remote file in your local copy of TextMate:

rmate path/to/file

In case you get this error message:
/usr/local/bin/rmate: line 412: /dev/tcp/localhost/52698: Connection refused
Put the following lines in your local ~/.ssh/config:

Host example.com
    RemoteForward 52698 127.0.0.1:52698

Clone this wiki locally