通过keytab连接到SQL Server时,在keytab文件中显示为SPN的警告不可用

时间:2019-07-16 07:11:33

标签: sql-server kerberos keytab

对于生成用于SQL Server kerberos身份验证的密钥表文件,我有些疑问。

SQL服务器的SPN为:

MSSQLSvc/myhost:1433@MYDOMAIN.COM 

我创建的密钥表文件为:

ktpass -out "C:\Users\myuser\KerberosConf\MSSQL\myappserver.keytab" -princ MSSQLSvc/myhost:1433@MYDOMAIN.COM -mapUser mydomain\myuser-pass Test@123 -crypto AES256-SHA1 -pType KRB5_NT_PRINCIPAL 

查看密钥表时,它显示为正确的SPN:

[1] Service principal: MSSQLSvc/myhost:1433@MYDOMAIN.COM KVNO: 18 

但是在引用密钥表文件进行身份验证时,会引发以下错误:

Debug is true storeKey true useTicketCache false useKeyTab true doNotPrompt true ticketCache is null isInitiator true KeyTab is C:/Users/myuser/KerberosConf/MSSQL/myappserver.keytab refreshKrb5Config is false principal is MSSQLSvc/myhost:1433@MYDOMAIN.COM tryFirstPass is false useFirstPass is false storePass is false clearPass is false Key for the principal MSSQLSvc/myhost:1433@MYDOMAIN.COM not available in C:/Users/myuser/KerberosConf/MSSQL/myappserver.keytab 

[Krb5LoginModule] authentication failed Unable to obtain password from user 

javax.security.auth.login.LoginException: Unable to obtain password from user 
at com.sun.security.auth.module.Krb5LoginModule.promptForPass(Unknown Source) 
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Unknown Source) 
at com.sun.security.auth.module.Krb5LoginModule.login(Unknown Source) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 

请帮助我解决此问题

0 个答案:

没有答案
相关问题