sshit => sshout

This commit is contained in:
Kenneth Reitz
2011-09-19 14:58:20 -05:00
parent 77241167e0
commit 09cbc5c367
8 changed files with 16 additions and 11 deletions
+5 -4
View File
@@ -26,14 +26,14 @@ if sys.version_info[0:2] < (2, 6):
required.append('simplejson')
setup(
name='sshit',
name='sshout',
version='0.0.0',
description='SSH it up.',
long_description=open('README.rst').read(),
author='Kenneth Reitz',
author_email='me@kennethreitz.com',
url='https://github.com/kennethreitz/sshit',
packages= ['sshit'],
url='https://github.com/kennethreitz/sshout',
packages= ['sshout'],
install_requires=required,
license='ISC',
classifiers=(
@@ -50,7 +50,8 @@ setup(
),
entry_points = {
'console_scripts': [
'sshit = sshit.cli:main'
'sshout = sshout.cli:main',
'tmpsshd = sshout.tmpsshd:main',
]
}
)
View File
View File
View File
@@ -10,6 +10,7 @@ from twisted.conch.ssh import factory, userauth, connection, keys, session
from twisted.internet import reactor, protocol, defer
from twisted.python import log
from zope.interface import implements
from twisted.conch.unix import UnixSSHRealm
import sys
log.startLogging(sys.stderr)
@@ -106,14 +107,17 @@ class ExampleFactory(factory.SSHFactory):
# portal = portal.Portal(ExampleRealm())
from twisted.conch.unix import UnixSSHRealm
portal = portal.Portal(UnixSSHRealm())
passwdDB = checkers.InMemoryUsernamePasswordDatabaseDontUse()
passwdDB.addUser('kreitz', 'password')
portal.registerChecker(passwdDB)
portal.registerChecker(InMemoryPublicKeyChecker())
ExampleFactory.portal = portal
def bootstrap(username):
from twisted.cred import portal
portal = portal.Portal(UnixSSHRealm())
passwdDB = checkers.InMemoryUsernamePasswordDatabaseDontUse()
passwdDB.addUser(username, 'password')
portal.registerChecker(passwdDB)
portal.registerChecker(InMemoryPublicKeyChecker())
ExampleFactory.portal = portal
if __name__ == '__main__':
bootstrap('kreitz')
reactor.listenTCP(5022, ExampleFactory())
reactor.run()
View File