diff options
author | yvesf <yvesf-git@xapek.org> | 2011-03-24 10:48:08 +0100 |
---|---|---|
committer | yvesf <yvesf-git@xapek.org> | 2011-03-24 10:48:08 +0100 |
commit | a91e8d650438278995e5adae30272cdcbb1f099f (patch) | |
tree | 6bd6b8fbed48748eb124c6da55ce80cd6a51c391 /offssh.py | |
parent | 050f39cfa2dac8366391a5443037f400a6ea8624 (diff) | |
download | offssh-a91e8d650438278995e5adae30272cdcbb1f099f.tar.gz offssh-a91e8d650438278995e5adae30272cdcbb1f099f.zip |
Diffstat (limited to 'offssh.py')
-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) |