def setUp(self):
        """
        Configure an SSH server with password authentication enabled for a
        well-known (to the tests) account.
        """
        SSHCommandClientEndpointTestsMixin.setUp(self)

        knownHosts = KnownHostsFile(FilePath(self.mktemp()))
        knownHosts.addHostKey(
            self.hostname, self.factory.publicKeys[b'ssh-rsa'])
        knownHosts.addHostKey(
            networkString(self.serverAddress.host),
            self.factory.publicKeys[b'ssh-rsa'])

        self.endpoint = SSHCommandClientEndpoint.newConnection(
            self.reactor, b"/bin/ls -l", self.user, self.hostname, self.port,
            password=self.password, knownHosts=knownHosts,
            ui=FixedResponseUI(False))

        Configure an SSH server with password authentication enabled for a
        well-known (to the tests) account.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_endpoints.py