TRAMP requires access to and rights to several commands on
To improve performance and accuracy of remote file access,
grep when available.
tramp-remote-path specifies which remote directory paths
TRAMP can search for How TRAMP finds and uses programs on the remote host.
TRAMP uses standard defaults, such as /bin and
/usr/bin, which are reasonable for most hosts. To accommodate
differences in hosts and paths, for example, /bin:/usr/bin on
Debian GNU/Linux or
Solaris, TRAMP queries the remote host with
PATH and updates the symbol
For instances where hosts keep obscure locations for paths for security reasons, manually add such paths to local .emacs as shown below for TRAMP to use when connecting.
(add-to-list 'tramp-remote-path "/usr/local/perl/bin")
Another way to find the remote path is to use the path assigned to the
remote user by the remote host. TRAMP does not normally retain
this remote path after login. However,
preserves the path value, which can be used to update
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
Note that this works only if your remote
shell supports the login argument ‘-l’.
Starting with Emacs 26,
tramp-remote-path can be set per
host via connection-local
You could define your own search directories like this:
(connection-local-set-profile-variables 'remote-path-with-bin '((tramp-remote-path . ("~/bin" tramp-default-remote-path))))
(connection-local-set-profile-variables 'remote-path-with-apply-pub-bin '((tramp-remote-path . ("/appli/pub/bin" tramp-default-remote-path))))
(connection-local-set-profiles '(:application tramp :machine "randomhost") 'remote-path-with-bin)
(connection-local-set-profiles '(:application tramp :user "anotheruser" :machine "anotherhost") 'remote-path-with-apply-pub-bin)
When remote search paths are changed, local TRAMP caches must be recomputed. To force TRAMP to recompute afresh, call M-x tramp-cleanup-this-connection RET or friends (see Cleanup remote connections).