diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py index d4e9c5cfd7ce25..57494a9d0dd7dc 100644 --- a/lib/ansible/plugins/connection/ssh.py +++ b/lib/ansible/plugins/connection/ssh.py @@ -677,7 +677,7 @@ def _bare_run(self, cmd, in_data, sudoable=True, checkrc=True): # only when using ssh. Otherwise we can send initial data straightaway. state = states.index('ready_to_send') - if b'ssh' in cmd and sudoable: + if to_bytes(self.get_option('ssh_executable')) in cmd and sudoable: if self._play_context.prompt: # We're requesting escalation with a password, so we have to # wait for a password prompt.