all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: suvayu ali <fatkasuvayu+linux@gmail.com>
Cc: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: edit a file over two linked ssh
Date: Mon, 21 Nov 2011 20:32:03 +0100	[thread overview]
Message-ID: <871ut1qnkc.fsf@gmx.de> (raw)
In-Reply-To: <CAMXnza3V4mmSrw-OT-myuazK17=cUJiTMJUUJcpX==JnnacoYA@mail.gmail.com> (suvayu ali's message of "Mon, 21 Nov 2011 16:46:54 +0100")

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	other threads:[~2011-11-21 19:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-20  8:10 edit a file over two linked ssh mehran khajavi
2011-11-20  9:20 ` Peter Dyballa
2011-11-20 11:14 ` Michael Albinus
2011-11-20 13:17   ` Philipp Haselwarter
2011-11-20 13:30     ` Michael Albinus
2011-11-21 15:46   ` suvayu ali
2011-11-21 19:32     ` Michael Albinus [this message]
2011-11-21 23:03       ` suvayu ali
2011-11-22  5:33         ` Michael Albinus
2011-11-22 12:53           ` suvayu ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ut1qnkc.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=fatkasuvayu+linux@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.