transport.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:obsoleted-vpduserv 作者: InfraSIM 项目源码 文件源码
def auth_none(self, username):
        """
        Try to authenticate to the server using no authentication at all.
        This will almost always fail.  It may be useful for determining the
        list of authentication types supported by the server, by catching the
        `.BadAuthenticationType` exception raised.

        :param str username: the username to authenticate as
        :return:
            `list` of auth types permissible for the next stage of
            authentication (normally empty)

        :raises BadAuthenticationType: if "none" authentication isn't allowed
            by the server for this user
        :raises SSHException: if the authentication failed due to a network
            error

        .. versionadded:: 1.5
        """
        if (not self.active) or (not self.initial_kex_done):
            raise SSHException('No existing session')
        my_event = threading.Event()
        self.auth_handler = AuthHandler(self)
        self.auth_handler.auth_none(username, my_event)
        return self.auth_handler.wait_for_response(my_event)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号