{"record":{"id":"6d574f5a6b246140","repo":"hashicorp/vagrant","slug":"ssh-executable-not-found-in-any-directories-in-t","errorCode":null,"errorMessage":"`ssh` executable not found in any directories in the %PATH% variable. Is an\nSSH client installed? Try installing Cygwin, MinGW or Git, all of which\ncontain an SSH client. Or use your favorite SSH client with the following\nauthentication information shown below:\n\nHost: %{host}\nPort: %{port}\nUsername: %{username}\nPrivate key: %{key_path}","messagePattern":"`ssh` executable not found in any directories in the %PATH% variable\\. Is an\nSSH client installed\\? Try installing Cygwin, MinGW or Git, all of which\ncontain an SSH client\\. Or use your favorite SSH client with the following\nauthentication information shown below:\n\nHost: %(.+?)\nPort: %(.+?)\nUsername: %(.+?)\nPrivate key: %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::SSHUnavailableWindows","httpStatus":null,"severity":"error","filePath":"lib/vagrant/util/ssh.rb","lineNumber":89,"sourceCode":"        # include ssh, notably git, mingw and cygwin, but make sure ssh is in the path!\n\n        # First try using the original path provided\n        if ENV[\"VAGRANT_PREFER_SYSTEM_BIN\"] != \"0\"\n          ssh_path = Which.which(\"ssh\", original_path: true)\n        end\n\n        # If we didn't find an ssh executable, see if we shipped one\n        if !ssh_path\n          ssh_path = Which.which(\"ssh\")\n          if ssh_path && Platform.windows? && (Platform.cygwin? || Platform.msys?)\n            LOGGER.warn(\"Failed to locate native SSH executable. Using vendored version.\")\n            LOGGER.warn(\"If display issues are encountered, install the ssh package for your environment.\")\n          end\n        end\n\n        if !ssh_path\n          if Platform.windows?\n            raise Errors::SSHUnavailableWindows,\n              host: ssh_info[:host],\n              port: ssh_info[:port],\n              username: ssh_info[:username],\n              key_path: ssh_info[:private_key_path].join(\", \")\n          end\n\n          raise Errors::SSHUnavailable\n        end\n\n        if Platform.windows?\n          # On Windows, we need to detect whether SSH is actually \"plink\"\n          # underneath the covers. In this case, we tell the user.\n          r = Subprocess.execute(ssh_path)\n          if r.stdout.include?(\"PuTTY Link\") || r.stdout.include?(\"Plink: command-line connection utility\")\n            raise Errors::SSHIsPuttyLink,\n              host: ssh_info[:host],\n              port: ssh_info[:port],\n              username: ssh_info[:username],","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/util/ssh.rb#L71-L107","documentation":"In Vagrant::Util::SSH.exec, after both the initial lookup and a fallback Which.which('ssh') fail to find an ssh executable on Windows, Vagrant raises SSHUnavailableWindows — including host, port, username and private key path in the message so you can connect manually with another client. Non-Windows hosts get the plain SSHUnavailable error instead.","triggerScenarios":"`vagrant ssh` on a Windows host where no OpenSSH client is on PATH: the optional OpenSSH Client feature is disabled, Git for Windows/Cygwin are not installed, or the invoking context (service, CI) has a sanitized PATH.","commonSituations":"Fresh Windows installs; hardened CI agents; PATH clobbered by other installers.","solutions":["Install the OpenSSH client: Settings > Apps > Optional Features > OpenSSH Client, or `Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0`","Or install Git for Windows / Cygwin (both ship ssh.exe) and put their bin directory on PATH","Or connect manually using the Host/Port/Username/Private key values the error prints, e.g. with PuTTY"],"exampleFix":"# before (Windows)\n> vagrant ssh   # SSHUnavailableWindows\n\n# after (admin PowerShell)\n> Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0\n> vagrant ssh","handlingStrategy":"validation","validationCode":"require 'vagrant/util/which'\nrequire 'vagrant/util/platform'\n\nif Vagrant::Util::Platform.windows? && !Vagrant::Util::Which.which('ssh')\n  abort 'install the Windows OpenSSH Client (or Git for Windows) before vagrant ssh'\nend","typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::Util::SSH.exec(machine.ssh_info)\nrescue Vagrant::Errors::SSHUnavailableWindows => e\n  puts e.message # contains Host/Port/Username/Private key for manual connect\nend","preventionTips":["Pre-install the OpenSSH Client in Windows images","Verify `where ssh` before scripting vagrant ssh","Keep the error's printed credentials as a PuTTY fallback workflow"],"tags":["ssh","windows","executable","path"],"backgroundTag":"ssh-executable-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}