From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: edit a file over two linked ssh Date: Mon, 21 Nov 2011 20:32:03 +0100 Message-ID: <871ut1qnkc.fsf@gmx.de> References: <8762ifujtt.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321903953 4539 80.91.229.12 (21 Nov 2011 19:32:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Nov 2011 19:32:33 +0000 (UTC) Cc: Emacs mailing list To: suvayu ali Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 21 20:32:29 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RSZbQ-0003oD-OS for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Nov 2011 20:32:28 +0100 Original-Received: from localhost ([::1]:58897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSZbP-00082Y-N9 for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Nov 2011 14:32:27 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSZbK-000823-Ft for help-gnu-emacs@gnu.org; Mon, 21 Nov 2011 14:32:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSZbJ-0002Xs-Br for help-gnu-emacs@gnu.org; Mon, 21 Nov 2011 14:32:22 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:46188) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RSZbI-0002XR-QN for help-gnu-emacs@gnu.org; Mon, 21 Nov 2011 14:32:21 -0500 Original-Received: (qmail invoked by alias); 21 Nov 2011 19:32:17 -0000 Original-Received: from p57BB963E.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.150.62] by mail.gmx.net (mp053) with SMTP; 21 Nov 2011 20:32:17 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1/d5VoI1CTdWYul3btIeQ5K6ONlTNg1uNmzSk9B3X VlvynMo99x4TjL In-Reply-To: (suvayu ali's message of "Mon, 21 Nov 2011 16:46:54 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.165.64.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82996 Archived-At: suvayu ali 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.