def _close(self):
        """ Close connection to remote host. """
        if self._process is None:
            return

        self.quit()

        self._process.stdin.close()

        logger.debug("Waiting for ssh process to finish...")
        self._process.wait()  # Wait for ssh session to finish.

        # self._process.terminate()
        # self._process.kill()

        self._process = None
Close connection to remote host.