Emacs: Tramp doesn't work

前端 未结 6 1669
無奈伤痛
無奈伤痛 2020-11-29 22:01

I tried to open a remote file via Emacs via Tramp.

(require \'tramp)
(setq tramp-default-method \"ssh\")

I get a message from Emacs

6条回答
  •  星月不相逢
    2020-11-29 22:26

    Your Windows ssh client is the key here, and the 'ssh' Tramp method is almost certainly wrong.

    If you're using Cygwin, then you need to use the 'sshx' method, and you probably need to use ssh-agent to handle authentication. Details are here: Using tramp with EmacsW32 and cygwin, possible?

    I imagine the same applies to any stand-alone ssh client which does not require a full Cygwin installation, but does use the Cygwin DLLs. (I mention this, because I'm pretty sure I remember seeing such a thing.)

    If you're using PuTTY then you want the 'plink' method, as Alex Ott pointed out. If the Wiki doesn't suffice, a search here will probably turn up solutions for configuring that approach.

    Other alternatives I can suggest are:

    1. Use the Cygwin-native Emacs. That will be slower than NTEmacs, but Tramp seems to work well with the 'ssh' method, and password-prompting works as well.

    2. Host a Linux VM on your Windows box, and run Emacs on that. That's a fairly large hoop to jump through, but it's my preferred way of using Tramp when working in Windows.

提交回复
热议问题