什么是"校长" kerbros-sspi的论点?

时间:2016-06-12 16:47:08

标签: python kerberos winrm

我尝试使用域帐户通过WinRM在Python(pywinrm)中连接到远程计算机,按照

中的说明进行操作

How to connect to remote machine via WinRM in Python (pywinrm) using domain account?

使用

session = winrm.Session(server, auth=('user@DOMAIN', 'doesNotMatterBecauseYouAreUsingAKerbTicket'), transport='kerberos')

但我得到了这个:

NotImplementedError("Can't use 'principal' argument with kerberos-sspi.")

我用google搜索"主要论点"我在数学中得到了它的意义,这是在complex_analysis(https://en.m.wikipedia.org/wiki/Argument_(complex_analysis))中,绝对不是正确的含义。我不是母语为英语的人,我被困在这里。

原始代码在这里: https://github.com/requests/requests-kerberos/blob/master/requests_kerberos/kerberos_.py

def generate_request_header(self, response, host, is_preemptive=False):

"""

Generates the GSSAPI authentication token with kerberos.

If any GSSAPI step fails, raise KerberosExchangeError

with failure detail.

"""


        # Flags used by kerberos module.

        gssflags = kerberos.GSS_C_MUTUAL_FLAG | kerberos.GSS_C_SEQUENCE_FLAG

        if self.delegate:

            gssflags |= kerberos.GSS_C_DELEG_FLAG


        try:

            kerb_stage = "authGSSClientInit()"

            # contexts still need to be stored by host, but hostname_override

            # allows use of an arbitrary hostname for the kerberos exchange

            # (eg, in cases of aliased hosts, internal vs external, CNAMEs

            # w/ name-based HTTP hosting)

            kerb_host = self.hostname_override if self.hostname_override is not None else host

            kerb_spn = "{0}@{1}".format(self.service, kerb_host)

            

            kwargs = {}

            # kerberos-sspi: Never pass principal. Raise if user tries to specify one.

            if not self._using_kerberos_sspi:

                kwargs['principal'] = self.principal

            elif self.principal:

                raise NotImplementedError("Can't use 'principal' argument with kerberos-sspi.")

非常感谢任何帮助。

0 个答案:

没有答案