Friday, November 30, 2012

Configing Emacs: TRAMP with Putty

I've already written how to configure TRAMP in Emacs, but it only works on Mac and Linux. Unfortunately there are some who continue to use Windows as a desktop platform.   While they may be second class netizens, they do not need to settle for second class remote editing.

Emacs is available for Windows.  For secure remote editing you need ssh.  Enter Putty, an excellent implementation of the SSH protocol for Windows.  Putty comes with plink.exe which is the command line executable.   Once you've installed Emacs and Putty on Windows you'll want to update the Path environment variable.

Right-click Computer → Properties → Advanced System Settings → Environment Variables



Once the Putty path has been appended, update your emacs config.  Set your default tramp method to be plink and the tramp auto save directory to your username's temp directory.

(require 'tramp)
(set-default 'tramp-auto-save-directory "C:\Users\<username>\AppData\Local\Temp")
(set-default 'tramp-default-method "plink")

This all you need to start remote editing with emacs using ssh. You can setup password-less logins to make it even easier.  And if you have to go through an intermediary ssh server you can use transparent multihop with Putty.

§

2 comments:

  1. The link to "setup password-less logins" goes nowhere

    ReplyDelete
  2. This was a big help, thanks! But you should change "C:\Users\\AppData\Local\Temp" into "C:/Users//AppData/Local/Temp".

    ReplyDelete