Next: Default Method, Previous: External transfer methods, Up: Configuration
Sometimes, the methods described before are not sufficient. Sometimes, it is not possible to connect to a remote host using a simple command. For example, if you are in a secured network, you might have to log in to a `bastion host' first before you can connect to the outside world. Of course, the target host may also require a bastion host. The format of multi-hop filenames is slightly different than the format of normal tramp methods.
A multi-hop file name specifies a method, a number of hops, and a localname (path name on the remote system). The method name is always multi.
Each hop consists of a hop method specification, a user name and a host name. The hop method can be an inline method only. The following hop methods are (currently) available:
The variant remsh uses the remsh command. It
should be applied on machines where remsh is used instead of
rsh.
Even though you must specify both user and host with an
su hop, the host name is ignored and only the user name is
used.
Some people might wish to use port forwarding with ssh or maybe they have to use a nonstandard port. This can be accomplished by putting a stanza in ~/.ssh/config for the account which specifies a different port number for a certain host name. But it can also be accomplished within tramp, by adding a multi-hop method. For example:
(add-to-list
'tramp-multi-connection-function-alist
'("sshf" tramp-multi-connect-rlogin "ssh %h -l %u -p 4400%n"))
Now you can use an sshf hop which connects to port 4400 instead of the standard port.