diff options
-rw-r--r-- | offssh.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -6,7 +6,7 @@ from twisted.cred import portal, checkers, credentials from twisted.conch import error, avatar from twisted.conch.checkers import SSHPublicKeyDatabase -from twisted.conch.ssh import factory, userauth, connection, keys, session +from twisted.conch.ssh import factory, userauth, connection, keys, session, transport from twisted.internet import reactor, protocol, defer from zope.interface import implements import sys @@ -113,7 +113,15 @@ class ExampleSession: from twisted.python import components components.registerAdapter(ExampleSession, ExampleAvatar, session.ISession) +class ModifiedSSHTransport(transport.SSHServerTransport): + protocolVersion = '2.0' + version = 'OpenSSH_4.3p2' + comment = 'Debian-9etch2' + ourVersionString = ('SSH-' + protocolVersion + '-' + version + ' ' + comment).strip() + + class ExampleFactory(factory.SSHFactory): + protocol = ModifiedSSHTransport publicKeys = { 'ssh-rsa': keys.Key.fromString(data=publicKey) } @@ -124,7 +132,6 @@ class ExampleFactory(factory.SSHFactory): 'ssh-userauth': userauth.SSHUserAuthServer, 'ssh-connection': connection.SSHConnection } - class PasswordDatabase: implements(checkers.ICredentialsChecker) |