diff --git a/lib/ansible/plugins/connection/paramiko_ssh.py b/lib/ansible/plugins/connection/paramiko_ssh.py index 904ed041408..7b91f6b90df 100644 --- a/lib/ansible/plugins/connection/paramiko_ssh.py +++ b/lib/ansible/plugins/connection/paramiko_ssh.py @@ -308,7 +308,7 @@ class Connection(ConnectionBase): if passprompt: if self._play_context.become and self._play_context.become_pass: - chan.sendall(self._play_context.become_pass + '\n') + chan.sendall(to_bytes(self._play_context.become_pass, errors='strict') + b'\n') else: raise AnsibleError("A password is reqired but none was supplied") else: