putty - How do I change the command sent by TRAMP in Emacs when using plink on Windows? -


i have following in .emacs:

(require 'tramp) (setq tramp-default-method "plink") 

when run c-x c-f /plink:some_session:/ in emacs some_session defined session in putty (which has information saved such location of private key, username, connection type=ssh, etc.), tramp issues following command (copied *messages* buffer):

tramp: sending command ‘plink -ssh -t some_session " env 'term=dumb' 'prompt_command=' 'ps1=#$ ' /bin/sh " && exit || exit’ 

you can see passes -ssh flag plink. works fine when connecting remote host expects ssh connection on port 22.

however, have remote host need connect on port 2222. if save session (some_new_session) in putty , try connect using following commands (or putty gui) happens:

  • using putty gui
    • works fine
  • plink some_new_session
    • issued cmd.exe - works fine , able connect
  • plink -ssh some_new_session
    • issued cmd.exe - not work

i have debugged issue , found when -ssh flag passed plink attempts connect on port 22 anyway though saved session states use port 2222. when given -ssh ignores port saved in session (which feels bug).

if try connect using c-x c-f /plink:some_new_session:/ in emacs command issued is:

tramp: sending command ‘plink -ssh -t some_new_session " env 'term=dumb' 'prompt_command=' 'ps1=#$ ' /bin/sh " && exit || exit’ 

i not need -ssh flag because connection type being ssh saved in putty session. -ssh flag forces connection through port 22 though session has saved port 2222.

my question is:

how can change command issued tramp not call plink -ssh flag?

the plink method intended use hostname. if want (reuse) session, use plinkx, c-x c-f /plinkx:some_session:/ , c-x c-f /plink:some_new_session:/.


Comments