Securely Editing Remote Files with a Local XEmacs

I use XEmacs for text editing. Somewhere along the line I discovered a feature called efs, which allows you to edit remote files with a local XEmacs. The benefit is that you can modify remote files without running a remote application over a network. The downside to efs is that it uses insecure ftp. Furthermore, it doesn’t appear that you can force efs to use a secure transfer program.

Fortunately, there is an alternative called tramp. I’ve read about tramp many times, but there was never a simple explanation of how to use it. That’s what I aim to do here.

The following discussion assumes that you have tramp installed on your system. That was the default when I installed XEmacs. Its also probably convenient to setup ssh-agent or the like so you don’t have to type in passwords all the time.

To setup tramp, I added the following lines to my .xemacs/init.el file:

(setq tramp-default-user "myname")
(setq tramp-default-method "ssh")
(require 'tramp)

To open a remote file, I use the following syntax:

/[machine]/file/location/on/remote/machine

If you don’t set tramp-default-user, and tramp-default-method, the fully qualified way to open a remote file is:

/[method/user@machine]/file/location/on/remote/machine

Note, the syntax I used above is slightly different than what I found at http://www.gnu.org/software/tramp/, which may explain why I had problems with tramp before. The “method” that is mentioned above, is the method that tramp uses to access remote files. See http://www.gnu.org/software/tramp/ for methods of accessing files, (such as ssh, scp, sshx), other parameters, details on how to obtain and install tramp, and further documentation.

Advertisements

~ by Ryan Lefever on February 23, 2006.

3 Responses to “Securely Editing Remote Files with a Local XEmacs”

  1. thanks.

  2. When copying in source code, don’t use Windows programs that do so-called smart quotes. You have them around the ssh so it doesn’t paste directly to init.el

  3. Brian,

    Thanks for the tip. I have fixed the quotes in the post.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

 
%d bloggers like this: