tramp multi hop ssh, and shell

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

tramp multi hop ssh, and shell

Joao Cortes

When hoping about an ssh gateway, 'tramp' performs a new connection each
time I call 'compile'.

For instance, If I do

C-x C-f /ssh:me@taurus|/ssh:me@aries:,

'tramp' correctly connects me to aries, asking for authentication for
both machines.  However, If I run 'compile' , or open a new shell with
'shell' while in an aries directory, Tramp reconnects to aries , asking
for authentication again and again.

If I do not hop about taurus, doing something like,

C-x C-f /ssh:me@aries,

running 'compile' does not cause a reconnection.

Can any one confirm this behaviour? If so, is this intendend?

Does anyone know how to make emacs treat a multi hop like a non hoping
connection?

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: tramp multi hop ssh, and shell

Michael Albinus
Joao Cortes <[hidden email]> writes:

Hi Joao,

> When hoping about an ssh gateway, 'tramp' performs a new connection each
> time I call 'compile'.
>
> For instance, If I do
>
> C-x C-f /ssh:me@taurus|/ssh:me@aries:,

I guess you mean /ssh:me@taurus|ssh:me@aries:

> 'tramp' correctly connects me to aries, asking for authentication for
> both machines.  However, If I run 'compile' , or open a new shell with
> 'shell' while in an aries directory, Tramp reconnects to aries , asking
> for authentication again and again.
>
> If I do not hop about taurus, doing something like,
>
> C-x C-f /ssh:me@aries,
>
> running 'compile' does not cause a reconnection.

`compile' calls `start-file-process-shell-command', which runs a new
process. How do you believe, Tramp does not "cause a reconnection"?

> Can any one confirm this behaviour? If so, is this intendend?
>
> Does anyone know how to make emacs treat a multi hop like a non hoping
> connection?

What could happen is that Tramp does not remember the already provided
passwords in case of multihops. Could you pls confirm that you mean this
scenario?

> Thanks

Best regards, Michael.

Reply | Threaded
Open this post in threaded view
|

Re: tramp multi hop ssh, and shell

jonetsu
In reply to this post by Joao Cortes
On Thu, 19 Dec 2019 10:17:51 +0000
Joao Cortes <[hidden email]> wrote:

> When hoping about an ssh gateway, 'tramp' performs a new connection
> each time I call 'compile'.

If before doing any of that you cd to the machine ?  Eg:

M-x cd
sshx:user@machine

Then perhaps open a dired C-x d.  Pick a .c file or anything, then run
M-x compile.

'compile' will take for granted the cd 'directory'.  At least it does
here, and doe snot ask again for a password.

Hope this helps.