I am trying to debug some bizarre issues with my exec-path settings.

When I debug PATH in shell, the key tool is "which", which tells me the absolute path we resolve for a given binary, i.e.

(701) % which ifconfig

Is there some equivalent to tell me, for example, what binary Tramp will get when it asks to execute "ssh"?

2 Answers 2


You can attempt locating an executable in exec-path with executable-find:

(executable-find "ls") ;=> "/usr/bin/ls"
(executable-find "sl") ;=> nil

Tramp provides a debugging buffer, usually *debug tramp...* that provides a lot of information. For example...

;; GNU Emacs: Tramp: 2.2.9-24.4 -*- mode: outline; -*-
17:54:29.340451 tramp-maybe-open-connection (3) # Opening connection for schwern.net using scp...
17:54:29.369182 tramp-maybe-open-connection (3) # Sending command `exec ssh   -o ControlPath=/var/folders/0b/7xp2lxbd7yl0tcpms06fr3d40000gn/T/tramp.40010Dqz.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none schwern.net'

You can see, it's running exec ssh which will pick up the normal ssh from your PATH. If you want to be sure you can run M-x shell and check which ssh or use the commands in @wasamasa's answer.

What tramp will use to login is controlled by the tramp-login-program argument to the particular method in the tramp-methods variable. For example, here's the ssh method.

  (tramp-login-program "ssh")
   (("-l" "%u")
    ("-p" "%p")
    ("-e" "none")
  (tramp-remote-shell "/bin/sh")
   (("-o" "GlobalKnownHostsFile=/dev/null")
    ("-o" "UserKnownHostsFile=/dev/null")
    ("-o" "StrictHostKeyChecking=no")))
  (tramp-default-port 22))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.