Next: Connecting to a remote host using multiple hops, Previous: Selecting a default user, Up: Configuring TRAMP [Contents][Index]
When host name is omitted, TRAMP substitutes the value from
the tramp-default-host
user option. It is initially
populated with the local host name where Emacs is running. The
default method, default user and default host can be overridden as
follows:
(custom-set-variables '(tramp-default-method "ssh") '(tramp-default-user "john") '(tramp-default-host "target"))
With all defaults set, /-:: will connect TRAMP to John’s home directory on ‘target’ via method ssh.
Instead of a single default host, tramp-default-host-alist
allows multiple default host values based on access method or user
name combinations. The alist can hold multiple values. While
tramp-default-host
is sufficient in most cases, some methods,
like adb, require defaults overwritten.
The default host name for nspawn is ‘.host’. Therefore, /nspawn:: and /sudo:: have the same effect.