Software Used:

Updated! Added links to installation; clarified instructions.

Setting up

  1. Install emacs.
  2. Install what you want from Cygwin yourself (which will give you a lot of the UNIX utilities that Emacs likes to use — but make sure you install ssh!). You might also find these two batch files useful: emacs.bat and ssh-askpass.bat.
  3. Install tramp.

At this point, if you were on UNIX, it would work. However, there are currently (as of 20 Nov 2001) some problems with ssh under emacs. If you try to start ssh under emacs, it will fail with the message "Pseudo-terminal will not be allocated because stdin is not a terminal."

To get around this problem, you need to use ssh-agent which means that you need to have a keypair available. The public key needs to be on the remote server. If you need help setting this up, see my write up on how to do this.

  1. Edit C:\WINNT\emacs.bat so that it points to the emacs binary.
  2. Add the remote host's key to your %HOME%/.ssh/known_hosts file. You can do this by making an initial connection to the host from a C:\> prompt.
  3. Start emacs by using the batch file. This will start ssh-agent and enable ssh-add to get the password via a batch file that uses Windows Scripting Host. You may want to create a desktop shortcut.
  4. M-x shell to get a C:\> prompt. Using this prompt, set up your keypair (see my instructions). This needs to be done from within emacs because of the funky interaction of ssh-askpass and ssh-add.
  5. M-x customize-option tramp-methods RET
  6. Change your preferred ssh option so that the tramp-rsh-args has, as the final two member of the list, "bash -i" and tramp-remote-sh is set to "bash -i" as well. Save your change.
  7. M-x customize-option tramp-default-method RET
  8. Set this to your preferred ssh option from two steps above.
  9. Tramp should work. Try a filename like /[]/etc/hosts.

If you tried this, please send me email and let me know if it works or not.

Other Resources

Also see Tom Roche's pages on ntemacs with cygwin and with putty.