def check_auth_password(self, username, password):
self.log.info("SSHServer: got username:%s password:%s" \
% (username, password))
try:
# Try the authentication to the server and return the response
self.sshproto.destt.auth_password(username, password)
except paramiko.AuthenticationException:
self.log.error("SSHProtocol: BAAAD AUTH")
return paramiko.AUTH_FAILED
return paramiko.AUTH_SUCCESSFUL
#if (username == 'sshtest') and (password == 'Intrepi0wn!'):
#return paramiko.AUTH_SUCCESSFUL
return paramiko.AUTH_FAILED
评论列表
文章目录