[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp 2.26 emacs 24.3 plink

From: MM
Subject: Re: tramp 2.26 emacs 24.3 plink
Date: Wed, 10 Sep 2014 15:10:05 +0100

On 16 July 2014 08:30, Michael Albinus <address@hidden> wrote:
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."
    (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---

I get this error:
Symbol's value as variable is void: tramp-actions-before-shell

Reminder: I have emacs 24.3.1 (i386-mingw) 2013-03-17, with tramp builin (so whatever version is that).
Then you might be able to open a file on the host with "C-x C-f

Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]