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

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

Re: Tramp and ssh control path


From: Suvayu Ali
Subject: Re: Tramp and ssh control path
Date: Mon, 15 Apr 2013 01:58:16 +0200
User-agent: Mutt/1.5.21 (2012-12-30)

Hello Michael,

Extremely sorry about the late response; I set it to respond later in
the day and forgot!

On Fri, Apr 12, 2013 at 11:34:30AM +0200, Michael Albinus wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > I noticed for a while now, tramp ignores my control path settings for a
> > remote host.
> 
> Yes, Tramp uses its own one. This is necessary, because Tramp cannot
> trust in an opened Master ssh connection opened outside Emacs. And OTOH,
> you won't be blocked in your ssh sessions outside due to a closed Tramp
> connection.

I guess this means I cannot share my tramp connection with my terminal
session outside of Emacs.

> > To elaborate, I have the following in my ~/.ssh/config.
> >
> > Host        *
> >     Protocol                2
> >     TCPKeepAlive            yes
> >     ServerAliveInterval     60
> >     ControlPath             /tmp/ssh-ControlPath-%r@%h:%p
> 
> For tests, I have added this as well to my ~/.ssh/config. Plus
> 
>     ControlMaster       auto
> 
> You don't need "-M" then for the first connection then.

Yes, I'm aware of that.  It is a deliberate choice to not have auto in
my config.  Sometimes I do not want to share connections between
sessions :).

> > Now I connect to a remote host from the terminal like this:
> >
> >   $ ssh -M remotehost
> >
> > For any subsequent connections from another terminal, I can do the
> > following to login without having to type my password.  SSH sees a
> > control path for the host exists, and establishes the subsequent
> > connection piggy-backing on the first.
> >
> >   $ ssh remotehost
> 
> So I did.
> 
> > Now when from emacs I try to open a remote file,
> >
> >   C-x C-f /remotehost:path/to/file RET
> >
> > I get prompted for a password: "Password for /ssh:remotehost: ".
> 
> Same here. 

As I mention above, I was hoping to share the connection with the
terminal session outside of Emacs.  If the connection was shared, I
wouldn't expect any password prompts.

> > Entering it doesn't let me open the remote file either.  The attached
> > log file has the messages from the Messages and tramp debug buffer.
> 
> No problem here. Tramp opens the file, using its own ControlPath.

I tried this again on a remotehost where I can use ssh keys (no password
prompts), there everything works as expected.  However repeating it for
the host where I have to use a password, fails as I described earlier.

> > Any ideas what is wrong?
> 
> The only strange entry in your logs is
> 
> 14:20:31.866172 tramp-process-sentinel (5) # Sentinel called: `*tramp/ssh 
> remotehost*' `alarm clock
> '
> 
> I have no idea where it comes from. The meaning is, that the process
> running ssh has been stopped.
> 
> Could you rerun your test with tramp-verbose set to 10, and show the
> result?

Okay I tried it.  The log has too much non-anonymous information to
clean up, so I am sending it off-list, I hope that is okay with you.

> > PS: While writing this email, I realised maybe there is a conflict with
> >     the ControlPath for remotehost and the ControlPath used by tramp.
> 
> They shouldn't conflict. They are just used for different sessions ...

Okay thanks, I think I understand.

Thanks a lot,

-- 
Suvayu

Open source is the future. It sets us free.



reply via email to

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