def check_auth_password(self, username, password):
self.logger.info('%s:%d: trying password authentication for "%s"' % (self.client_address + (username,)))
# Check the username
upstream = self._findUpstream(username)
if not upstream:
return paramiko.AUTH_FAILED
# Local authentication
if upstream.password and not (upstream.password == password):
self.logger.critical('%s:%d: local authentication of "%s" failed' % (self.client_address + (username,)))
return paramiko.AUTH_FAILED
# Connect to the upstream
if not upstream.upstream_password:
upstream.upstream_password = password
return self._connectToUpstream(upstream, password=True)
评论列表
文章目录