Emacs + tramp + plink

2019-04-13 05:51发布

问题:

I'm trying to get emacs tramp running under Windows XP to work over putty plink on an Amazon EC2 instance. The documentation for doing this is sparse. I can find partial documentation, but none that addresses all the steps required to get this working.

Can anyone provide a walk through, or a pointer to a walk through?

回答1:

(add-to-list 'load-path
 (expand-file-name "C:/tools/emacsw32/emacs/lisp/tramp/lisp"))
(require 'tramp)
;(setq tramp-chunksize "500")
(setq tramp-default-method "plink")

from my dot-emacs file. If I find more notes, I shall add them here.



回答2:

I'll assume you have a GNU/Linux server you want to access, a username and a .ppk file. Also, Emacs 24.4+.

First set up server in PuTTY Configuration

  1. In section Session, specify Host Name, for example username@server.
  2. Go to section Connection > SSH > Auth and Browse for your "Private key file for authentication".
  3. Back to section Session, name your Saved Sessions, for example putty-test, and click Save button.
  4. Check your connection by clicking the Open button. If it works, you can close these now.

Next, head to your Emacs.

  1. Make sure Emacs knows where your plink.exe is. One way is to just inform Emacs directly in your .emacs, for instance I have at the moment, (setenv "PATH" (concat "c:/Users/Brady/Documents/putty/;" (getenv "PATH")))
  2. Simply type C-x C-f //plink:putty-test:/ RET. Wait a moment while it connects, and window will open to dired buffer on the remote ~/ directory.