Tramp requires access to and rights to several commands on remote hosts: ls, test, find and cat.
Besides there are other required programs for Inline methods and External methods of connection.
To improve performance and accuracy of remote file access, Tramp uses perl (or perl5) and grep when available.
tramp-remote-pathspecifies which remote directory paths Tramp can search for Remote programs.
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 /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin on Solaris, Tramp queries the remote host with getconf 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,
tramp-own-remote-pathpreserves the path value, which can be used to update
tramp-remote-path.(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
Note that this works only if your remote /bin/sh shell supports the login argument ‘-l’.
When remote search paths are changed, local Tramp caches must be recomputed. To force Tramp to recompute afresh, exit Emacs, remove the persistent file (see Connection caching), and restart Emacs.