, .
, , . = [('Password: ', False)]
.
= []
, (Redhat, Ubuntu, OpenSUSE)
from twisted.conch.ssh import keys, userauth
class ClientUserAuth(userauth.SSHUserAuthClient):
def getPassword(self, prompt = None):
print "PASSWORD AUTH"
return defer.succeed('*****')
def getGenericAnswers(self, name, instruction, prompts):
print "INTERACTIVE AUTH"
response = ['']*len(prompts)
for i, p in enumerate(prompts):
try:
if('password' in p[0].lower()):
response[i] = '*****'
except:
pass
return defer.succeed(response)
>
Twisted , Conch .
from twisted.python import log
log.msg('Started Logging for A Conch Program')
log.startLogging(sys.stdout)