[Top][All Lists]

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

Re: tramp (2.1.11-pre); upgrade to gutsy and cannot open files on one se

From: Michael Albinus
Subject: Re: tramp (2.1.11-pre); upgrade to gutsy and cannot open files on one server
Date: Mon, 29 Oct 2007 15:04:03 +0100
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux)

Martin Flack <address@hidden> writes:

> Hi Michael,

Hi Martin,

> No, there's a difference, let me explain again better than I did
> before: /ssh:localhost#22 would give me ssh into the machine I am
> sitting at; whereas /ssh:localhost#3001 is giving me ssh into a server
> somewhere else. This is my way of connecting into machines that have
> been locked down to accept connections from only my office fixed IP
> address when I'm at home or traveling; rather than bother my clients
> with changing their rules, I just manage my own office's trusted IP's
> and bounce through. For example - before opening emacs, from home, I
> open an ssh connection at a command prompt to my office and tunnel a
> port, locally 3001, to 22 on a web server to which my office server can
> connect. Because of access restrictions I cannot simply connect directly
> to the web server from home. So in this case, the port being opened
> makes a big difference because you end up talking to a different
> computer.

I understand your scenario now. Thanks.

But it is not only the localhost optimization Tramp might be confused
when you tunnel your connection via a local port. This could be
avoided easily if you connect to "/ssh:" or
"/ssh:solvent#3001:".  Tramp checks only for the hostname "localhost",
so it wouldn't apply the optimizations then.

But there is a more general problem. Tramp caches host information for
reuse. Therefore, it must distinguish hosts. "localhost" and
"localhost#3001" are the same host for Tramp - it would be confused
reusing host related information if you would use both in parallel.

It would be better to use different host names when you are on
different hosts. What about the following ~/.ssh/config entry:

Host dev-connotea-vm1
     HostName   localhost
     Port       3001

Then you can open "/ssh:dev-connotea-vm1:", and you will go to the
right host.

Another possibility would be to configure Tramp's multi-hops. This
would avoid to open the local sshd listening on port 3001 - Tramp
could do the several hops for you. 

> One possibility which comes to mind to double-check if a local copy is
> going to work is not just the use of "localhost" but also
> what /bin/hostname says through that connection as compared to
> launching /bin/hostname from emacs, because on the same machine they
> should be the same. After connecting to localhost on port 22 you'd get,
> for example, "solvent" from /bin/hostname, but on ssh to port 3001,
> you'd get "dev-connotea-vm1" or something else.

It would be an option, yes. But I try to keep Tramp performant; every
additional check which requires a command on the remote side decreases
this. That's why Tramp keeps a connection history for reuse.

However, I will explain these traps in the Tramp manual to give the
users an understanding what's needed.

> Thanks very much for looking into this,
> Martin

Best regards, Michael.

reply via email to

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