Emacs, TRAMP, Ubuntu

This will be old news to experienced Emacs users but I just discovered it. Emacs allows you to edit remote files and by default, uses an FTP implementation named ange-ftp. FTP = plain-text password transmission = bad.

TRAMP is an Emacs extension which allows secure login to edit remote files. It may or may not be bundled with your Emacs distribution. No problem for Ubuntu; just “sudo apt-get install tramp”. Then edit your ~/.emacs to include the line:

(setq tramp-default-method "ssh")

To open a remote file in Emacs, do C-x C-f as usual and enter:

/ssh:user@hostname:/path/to/file

My version is a little buggy in that I get the message “Args out of range 0,0” if I mess with the Emacs window size, so maximise your window and leave it that way if you have the same problem.

One thought on “Emacs, TRAMP, Ubuntu

  1. If, like me, you work on a remote machine that you have to tunnel to, you can first create an ssh tunnel bound to a local port (say 2345), and then:

    /ssh:user@hostname#2345:/path/to/file

Comments are closed.