|
From: | MM |
Subject: | Re: tramp 2.26 emacs 24.3 plink |
Date: | Wed, 10 Sep 2014 15:10:05 +0100 |
MM <address@hidden> writes:
> The update here is that I've found a sort of gateway machine to which
> I can ssh, but this box runs some sort of forwarder where it
> 1. prints the string "Host:"
> 2. waits for user input for the hostname to forward to
> 3. connects and runs a login shell on the entered hostname
>
> Is there a way to make Tramp work with this?
Yes. See the Tramp manual for this
(info "(tramp) Remote shell setup")
You could adapt the example like this:
--8<---------------cut here---------------start------------->8---
(defconst my-tramp-prompt-regexp
(concat (regexp-quote "Host:") "\\s-*")
"Regular _expression_ matching my login prompt question.")
(defun my-tramp-action (proc vec)
"Enter the host name in order to give a correct answer."
(save-window-excursion
(with-current-buffer (tramp-get-connection-buffer vec)
(tramp-message vec 6 "\n%s" (buffer-string))
(tramp-send-string vec "hostname")))) ;; Use the real host name
;; instead of "hostname".
(eval-after-load "tramp-sh"
(add-to-list 'tramp-actions-before-shell
'(my-tramp-prompt-regexp my-tramp-action)))
--8<---------------cut here---------------end--------------->8---
Then you might be able to open a file on the host with "C-x C-f
/plink:address@hidden|address@hidden:/path/to/file".
Best regards, Michael.
[Prev in Thread] | Current Thread | [Next in Thread] |