I am using emacs with the tramp extension to edit files on a remote server using ssh. I had to pull in various hacks to get it to work so I hope these notes might help others.
- Install Emacs for Windows and Cygwin with OpenSSH
- Upgrade emacs Tramp to the latest version. This is best done using Cygwin bash and Cygwin make (in particular ensure that --with-lispdir and --infodir options are set correctly when running configure).
- Handy tip -- leave the tramp build directory hanging around. When you next upgrade Emacs it's just
make install (providing you use same directory names)
- Ensure that the Cygwin bin directory is on the Windows system path
- At the Cygwin bash prompt test ssh connection to your host
- Generate public/private keys and upload to the host
- Test ssh again to see if public authentication works (it did not for me because it had been disabled by the UNIX admin)
- Configure emacs to use tramp
;;(setq tramp-debug-buffer t)
;;(setq tramp-verbose 10)
(setq tramp-auto-save-directory "c:\\tmp")
(setq tramp-default-method "plink")
- Start emacs and test connection (C-x C-f) using cygwin ssh/scp/sftp. If it works skip to step 14. I had issues so I continued with step 9
- Install the Putty program suite
- Test the connection using putty
- Ensure the Putty install directory is on the system PATH
- In emacs visit the host (C-x C-f) using the method 'plink'. If that does not work you are on your own (but see troubleshooting below)
- If the public keys worked in ssh then import your OpenSSH keys into Putty
- Use emacs bookmarks to save your common host locations
With many thanks to all the folks on the web who documented their experiences and Michael Albinus on the tramp-devl mailing list.
- Getting rid of the "Couldn't find exit status of `test -e ..." error message by deleting ~/emacs.d/tramp file. This clears cached settings as documented at http://www.nabble.com/Emacs-tramp-troubles-with-old-Sun-tt13607411.html.
- If Tramp and Emacs does not work for you try these alternatives:
- Vim has a netrw plugin
- Both FileZilla and WinSCP have options to edit a file from the remote file system which then invokes a local Windows editor of your choice.
- jEdit has an ftp plugin that supports sftp and bookmarks