Previous: Auto-save and Backup, Up: Configuration

4.17 Issues with Cygwin ssh

This section needs a lot of work! Please help.

The recent Cygwin installation of ssh works only with a Cygwinized Emacs. You can check it by typing M-x eshell, and starting ssh test.machine. The problem is evident if you see a message like this:

     Pseudo-terminal will not be allocated because stdin is not a terminal.

Older ssh versions of Cygwin are told to cooperate with tramp selecting sshx as the connection method. You can find information about setting up Cygwin in their FAQ at

If you wish to use the scpx connection method, then you might have the problem that Emacs calls scp with a Windows filename such as c:/foo. The Cygwin version of scp does not know about Windows filenames and interprets this as a remote filename on the host c.

One possible workaround is to write a wrapper script for scp which converts the Windows filename to a Cygwinized filename.

If you want to use either ssh based method on Windows, then you might encounter problems with ssh-agent. Using this program, you can avoid typing the pass-phrase every time you log in. However, if you start Emacs from a desktop shortcut, then the environment variable SSH_AUTH_SOCK is not set and so Emacs and thus tramp and thus ssh and scp started from tramp cannot communicate with ssh-agent. It works better to start Emacs from the shell.

If anyone knows how to start ssh-agent under Windows in such a way that desktop shortcuts can profit, please holler. I don't really know anything at all about Windows...