How to use the sus.SusServer function in sus

To help you get started, we’ve selected a few sus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github patins / sus_ssh / sus.py View on Github external
def handle(self):
            try:
                transport = paramiko.Transport(self.request)
                transport.add_server_key(host_key)
                server = SusServer()
                transport.start_server(server=server)

                channel = transport.accept(20)
                if channel is None:
                    raise Exception('No channel')

                server.event.wait(10)
                if not server.event.is_set():
                    raise Exception('No shell')

                channel.send(f"Enter passphrase for key '/Users/{server.sent_username}/.ssh/id_ed25519': ")

                f = channel.makefile("rU")

                passphrase = f.readline().strip("\r\n")
                channel.send(f"\r\nI'm the server, and your passphrase is: {passphrase}\r\n")

sus

Really simple static website URL shortener

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis