Remotely editing files securely with emacs

A long time ago I used the built in ftp support for emacs to be able to remotely edit files on another system.  This gave me all the convenience of a local editor (especially on slower links), with the ability to do edits right in place on other systems.  On whim I did a quick search to see if there was a way to do this over an encrypted session while trying to fix some php templates.

Low and behold, there is.  It only takes the following 2 lines in your .emacs file:

(require 'tramp)
(setq tramp-default-method "scp")

Then you just open /servername:directory.  Relative directories base off your home dir, absolute do what you would expect.  This is just far too handy, and I can’t believe I’ve gone this long without knowing about it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s