<s> """<STR_LIT>""" <EOL> from twisted . conch import checkers , unix <EOL> from twisted . conch . openssh_compat import factory <EOL> from twisted . cred import portal <EOL> from twisted . python import usage <EOL> from twisted . application import strports <EOL> try : <EOL> from twisted . cred import pamauth <EOL> except ImportError : <EOL> pamauth = None <EOL> class Options ( usage . Options ) : <EOL> synopsis = "<STR_LIT>" <EOL> longdesc = "<STR_LIT>" <EOL> optParameters = [ <EOL> [ "<STR_LIT>" , "<STR_LIT:i>" , "<STR_LIT>" , "<STR_LIT>" ] , <EOL> [ "<STR_LIT:port>" , "<STR_LIT:p>" , "<STR_LIT>" , "<STR_LIT>" ] , <EOL> [ "<STR_LIT:data>" , "<STR_LIT:d>" , "<STR_LIT>" , "<STR_LIT>" ] , <EOL> [ "<STR_LIT>" , "<STR_LIT>" , None , "<STR_LIT>" <EOL> "<STR_LIT>" ] <EOL> ] <EOL> zsh_actions = { "<STR_LIT:data>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } <EOL> def makeService ( config ) : <EOL> t = factory . OpenSSHFactory ( ) <EOL> t . portal = portal . Portal ( unix . UnixSSHRealm ( ) ) <EOL> t . portal . registerChecker ( checkers . UNIXPasswordDatabase ( ) ) <EOL> t . portal . registerChecker ( checkers . SSHPublicKeyDatabase ( ) ) <EOL> if pamauth is not None : <EOL> from twisted . cred . checkers import PluggableAuthenticationModulesChecker <EOL> t . portal . registerChecker ( PluggableAuthenticationModulesChecker ( ) ) <EOL> t . dataRoot = config [ '<STR_LIT:data>' ] <EOL> t . moduliRoot = config [ '<STR_LIT>' ] or config [ '<STR_LIT:data>' ] <EOL> port = config [ '<STR_LIT:port>' ] <EOL> if config [ '<STR_LIT>' ] : <EOL> port += '<STR_LIT>' + config [ '<STR_LIT>' ] <EOL> return strports . service ( port , t ) </s>
