Jump to navigation Jump to search
1,411 bytes added ,  05:10, 24 July 2013
→‎Multiple hops: in emacs24 works great
== Multiple hops ==
=== No config in Emacs24 ===
As of Emacs 24, an analog of the old multi-hop syntax has been layered on top of the modern '''tramp-default-proxies-alist''' approach, meaning that you can once again perform multi-hops without any prior configuration. For details, see:
{{Keys | C-hig}} (tramp) Ad-hoc multi-hops RET
With the new syntax, each 'hop' is separated by '''|''' (pipe). In this instance, it would look like:
{{Keys | C-xC-f}} /ssh:user@server|sudo:server:/home/user/file RET
As this still uses the proxy mechanism underneath,
{{Keys | C-hv}} tramp-default-proxies-alist RET
should now include the value:
<code>("server" "root" "/ssh:user@server:")</code>
Meaning that the proxy <code>/ssh:user@server:</code> is going to be used whenever you request a file as <code>root@server</code>.
Something important to note here is that you usually don't need to specify ''server'' in the ''sudo:server'' part -- and indeed ''sudo::'' will still work in a sense -- however if you do that then the dynamic proxy created will contain the hostname you originated from rather than the host you connected to, so I would recommend being explicit; otherwise it will not only look confusing (as the wrong host will be displayed in filenames), but it will also mean that subsequent attempts to use ''sudo::'' on the localhost will be proxied to this remote server!
=== Configuration for all emacs versions ===
To set up multiple hop connections you will need to do a little bit of configuration.

Navigation menu