Next: , Previous: File name completion, Up: Usage

5.3 Declaring multiple hops in the file name

Multiple hops are configured with the variable tramp-default-proxies-alist (see Multi-hops). However, sometimes it is desirable to reach a remote host immediately, without configuration changes. This can be reached by an ad-hoc specification of the proxies.

A proxy looks like a remote file name specification without the local file name part. It is prepended to the target remote file name, separated by ‘|’. As an example, a remote file on ‘you@remotehost’, passing the proxy ‘bird@bastion’, could be opened by

     
     
     C-x C-f /ssh:bird@bastion|ssh:you@remotehost:/path

Multiple hops can be cascaded, separating all proxies by ‘|’. The proxies can also contain the patterns %h or %u.

The ad-hoc definition is added on the fly to tramp-default-proxies-alist. Therefore, during the lifetime of the Emacs session it is not necessary to enter this ad-hoc specification, again. The remote file name ‘/ssh:you@remotehost:/path’ would be sufficient from now on.

— User Option: tramp-save-ad-hoc-proxies

This customer option controls whether ad-hoc definitions are kept persistently in tramp-default-proxies-alist. That means, those definitions are available also for future Emacs sessions.