help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: edit a file over two linked ssh


From: Michael Albinus
Subject: Re: edit a file over two linked ssh
Date: Mon, 21 Nov 2011 20:32:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hi Michael,

Hi,

> I have a similar but a more complicated situation. I have to connect to
> a remote machine hidden behind two gateway machines. Is this possible
> using multi-hop?

Yes.

> To illustrate with examples if the publicly accessible machine is
> publichost, the internal gateway is intgw and the machine I want to
> connect to is remotehost behind intgw, how do I achieve this with tramp?
>
> I tried to set tramp-default-proxies-alist to something like this:
>
> (("remotehost.\+" nil "/ssh:publichost:ssh:intgw:"))
>
> But this doesn't seem to do anything. Any ideas?
>
> PS: I use "remotehost.\+" because there are a number of remote machines
>     behind the internal gateway machine with a common leading part of the
>     name (e.g. remotehost1, remotehost2, ...)

You haven't said which user to apply on publichost and intgw. I assume
publicuser and intuser. Then you could do

(add-to-list 'tramp-default-proxies-alist
             '("remotehost.\+" nil "/ssh:intuser@intgw:"))
(add-to-list 'tramp-default-proxies-alist
             '("intgw" nil "/ssh:publicuser@publichost:"))

Note, that the order of both forms matters. Now you can open "C-x C-f
/remoteuser@remotehost1:/path/to/file".

If you want to apply the ad-hoc multi-hops from recent Tramp in the CVS
repository, you would apply "C-x C-f
/ssh:publicuser@publichost|ssh:intuser@intgw|remoteuser@remotehost1:/path/to/file".

Best regards, Michael.



reply via email to

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