当前位置: 首页>>代码示例>>Python>>正文


Python paramiko.AUTH_FAILED属性代码示例

本文整理汇总了Python中paramiko.AUTH_FAILED属性的典型用法代码示例。如果您正苦于以下问题:Python paramiko.AUTH_FAILED属性的具体用法?Python paramiko.AUTH_FAILED怎么用?Python paramiko.AUTH_FAILED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在paramiko的用法示例。


在下文中一共展示了paramiko.AUTH_FAILED属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_auth_interactive_response

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_interactive_response(self, responses):
        if self.username in ['pass2fa', 'pkey2fa']:
            if not self.password_verified:
                if responses[0] == 'password':
                    print('password verified')
                    self.password_verified = True
                    if self.username == 'pkey2fa':
                        return self.check_auth_interactive(self.username, '')
                else:
                    print('wrong password: {}'.format(responses[0]))
                    return paramiko.AUTH_FAILED
            else:
                if responses[0] == 'passcode':
                    print('totp verified')
                    return paramiko.AUTH_SUCCESSFUL
                else:
                    print('wrong totp: {}'.format(responses[0]))
                    return paramiko.AUTH_FAILED
        else:
            return paramiko.AUTH_FAILED 
开发者ID:huashengdun,项目名称:webssh,代码行数:22,代码来源:sshserver.py

示例2: check_auth_password

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_password(self, username, password):
		logger.info("-=-=- %s -=-=-\nUser: %s\nPassword: %s\n" % (self.client_address[0], username, password))
		
		print " IP: %s\n User: %s\n Pass: %s\n" % (self.client_address[0], username, password)
			
		if DENY_ALL == True:
			return paramiko.AUTH_FAILED
		f = open("blocked.dat").read()
		if self.client_address[0] in f:
			if ran:
				new_key()
			return paramiko.OPEN_FAILED_UNKNOWN_CHANNEL_TYPE
		else:
			f = open("blocked.dat","a")
			deepscan(self.client_address[0],f)
		paramiko.OPEN_FAILED_CONNECT_FAILED
		if (username == "root"):
			return paramiko.AUTH_SUCCESSFUL
		return paramiko.AUTH_FAILED 
开发者ID:RussianOtter,项目名称:networking,代码行数:21,代码来源:FunnyHoney.py

示例3: check_auth_password

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_password(self, username, password):
		logger.info("-=-=- %s -=-=-\nUser: %s\nPassword: %s\n" % (self.client_address[0], username, password))
		
		print " IP: %s\n User: %s\n Pass: %s\n" % (self.client_address[0], username, password)
			
		if DENY_ALL == True:
			return paramiko.AUTH_FAILED
		f = open("blocked.dat","r")
		data = str(f.readlines()).find(self.client_address[0])
		if data > 1:
			if ran:
				new_key()
			return paramiko.PasswordRequiredException
		else:
			f = open("blocked.dat","a")
			deepscan(self.client_address[0],f)
		paramiko.OPEN_FAILED_CONNECT_FAILED
		if (username == "root") and (password in PASSWORDS):
			return paramiko.AUTH_SUCCESSFUL
		return paramiko.AUTH_FAILED 
开发者ID:RussianOtter,项目名称:networking,代码行数:22,代码来源:RoHoneypot.py

示例4: check_auth_gssapi_with_mic

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_gssapi_with_mic(
        self, username, gss_authenticated=paramiko.AUTH_FAILED, cc_file=None
    ):
        self.plog("check_auth_gssapi_with_mic: username='%s'" % (
            username
        ))
        return paramiko.AUTH_FAILED 
开发者ID:gynvael,项目名称:stream,代码行数:9,代码来源:demo_server.py

示例5: check_auth_gssapi_keyex

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_gssapi_keyex(
        self, username, gss_authenticated=paramiko.AUTH_FAILED, cc_file=None
    ):
        self.plog("check_auth_gssapi_keyex: username='%s'" % (
            username
        ))
        return paramiko.AUTH_FAILED 
开发者ID:gynvael,项目名称:stream,代码行数:9,代码来源:demo_server.py

示例6: check_auth_publickey

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_publickey(self, username, key):
        try:
            _, known_public_key = self.server._users[username]
        except KeyError:
            self.log.debug("Unknown user '%s'", username)
            return paramiko.AUTH_FAILED
        if known_public_key == key:
            self.log.debug("Accepting public key for user '%s'", username)
            return paramiko.AUTH_SUCCESSFUL
        self.log.debug("Rejecting public ley for user '%s'", username)
        return paramiko.AUTH_FAILED 
开发者ID:carletes,项目名称:mock-ssh-server,代码行数:13,代码来源:server.py

示例7: check_auth_gssapi_with_mic

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_gssapi_with_mic(self, username,
                                   gss_authenticated=paramiko.AUTH_FAILED,
                                   cc_file=None):
        LOG.info("REQUEST: CHECK_AUTH_GSSAPI_MIC %s %s (fp: %s)"%(repr(username),gss_authenticated,cc_file))
        LOG.info("* SUCCESS")
        return paramiko.AUTH_SUCCESSFUL 
开发者ID:tintinweb,项目名称:pub,代码行数:8,代码来源:poc.py

示例8: check_auth_gssapi_keyex

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_gssapi_keyex(self, username,
                                gss_authenticated=paramiko.AUTH_FAILED,
                                cc_file=None):
        LOG.info("REQUEST: CHECK_AUTH_GSSAPI_KEY %s %s (fp: %s)"%(repr(username),gss_authenticated,cc_file))
        return paramiko.AUTH_SUCCESSFUL 
开发者ID:tintinweb,项目名称:pub,代码行数:7,代码来源:poc.py

示例9: check_auth_gssapi_with_mic

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_gssapi_with_mic(self, username,
                                   gss_authenticated=paramiko.AUTH_FAILED,
                                   cc_file=None):
        """
        .. note::
            We are just checking in `AuthHandler` that the given user is a
            valid krb5 principal! We don't check if the krb5 principal is
            allowed to log in on the server, because there is no way to do that
            in python. So if you develop your own SSH server with paramiko for
            a certain platform like Linux, you should call ``krb5_kuserok()`` in
            your local kerberos library to make sure that the krb5_principal
            has an account on the server and is allowed to log in as a user.

        .. seealso::
            `krb5_kuserok() man page
            <http://www.unix.com/man-page/all/3/krb5_kuserok/>`_
        """
        if gss_authenticated == paramiko.AUTH_SUCCESSFUL:
            return paramiko.AUTH_SUCCESSFUL
        return paramiko.AUTH_FAILED 
开发者ID:hpe-storage,项目名称:python-hpedockerplugin,代码行数:22,代码来源:demo_server.py

示例10: check_auth_gssapi_keyex

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_gssapi_keyex(self, username,
                                gss_authenticated=paramiko.AUTH_FAILED,
                                cc_file=None):
        if gss_authenticated == paramiko.AUTH_SUCCESSFUL:
            return paramiko.AUTH_SUCCESSFUL
        return paramiko.AUTH_FAILED 
开发者ID:hpe-storage,项目名称:python-hpedockerplugin,代码行数:8,代码来源:demo_server.py

示例11: check_auth_gssapi_with_mic

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_gssapi_with_mic(self, username,
                                   gss_authenticated=paramiko.AUTH_FAILED,
                                   cc_file=None):
        if gss_authenticated == paramiko.AUTH_SUCCESSFUL:
            return paramiko.AUTH_SUCCESSFUL
        return paramiko.AUTH_FAILED 
开发者ID:hpe-storage,项目名称:python-hpedockerplugin,代码行数:8,代码来源:test_ssh_gss.py

示例12: check_auth_publickey

# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import AUTH_FAILED [as 别名]
def check_auth_publickey(self, username, key):
        try:
            expected = FINGERPRINTS[key.get_name()]
        except KeyError:
            return paramiko.AUTH_FAILED
        else:
            if key.get_fingerprint() == expected:
                return paramiko.AUTH_SUCCESSFUL
        return paramiko.AUTH_FAILED 
开发者ID:hpe-storage,项目名称:python-hpedockerplugin,代码行数:11,代码来源:test_ssh_gss.py


注:本文中的paramiko.AUTH_FAILED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。