code: def _run_configure_script(self, script):
          
  
          _, tmpFile = tempfile.mkstemp()
          with open(tmpFile, 'w') as f:
              f.write(script)
  
          try:
              # get ssh client
              ssh = self._get_ssh_client(
                  self.host,
                  "ubuntu",
                  self.private_key_path,
              )
  
              # copy the local copy of the script to the remote machine
              sftp = paramiko.SFTPClient.from_transport(ssh.get_transport())
              sftp.put(
                  tmpFile,
                  tmpFile,
              )
  
              # run the provisioning script
              stdout, stderr = self._run_command(
                  ssh,
                  "sudo /bin/bash {}".format(tmpFile),
              )
  
          except paramiko.ssh_exception.AuthenticationException as e:
              raise e
          finally:
              os.remove(tmpFile)
              ssh.close()
docs: Run the script to install the Juju agent on the target machine.
  
          :param str script: The script returned by the ProvisioningScript API
          :raises: :class:`paramiko.ssh_exception.AuthenticationException`
              if the upload fails