<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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