From a91e8d650438278995e5adae30272cdcbb1f099f Mon Sep 17 00:00:00 2001 From: yvesf Date: Thu, 24 Mar 2011 10:48:08 +0100 Subject: set old debian-ssh version string --- offssh.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'offssh.py') diff --git a/offssh.py b/offssh.py index 725affc..575524c 100644 --- a/offssh.py +++ b/offssh.py @@ -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) -- cgit v1.2.1