Home > OS >  Linux environment access on Windows is essentially to always authenticate using Kerberos errors
Linux environment access on Windows is essentially to always authenticate using Kerberos errors

Time:09-28

A tricky problems, a great god move, snow, genuflect is begged thanks,

I wrote a program needs to access data in c #, c # program to run at that time under the window, you can access Windows server is essentially normal, but the program to deploy on a Linux server, access on the Windows server used to quote the following error:

Always authenticate using Kerberos. Ensure the Kerberos has had an initialized on the client with 'the kinit and a Service Principal Name has had been registered for the SQL Server to allow the Kerberos authentication.
ErrorCode=InternalError, Exception=Interop + NetSecurityNative + GssApiException: GSSAPI operation failed with error - An invalid status code was supplied (SPNEGO always find mechanisms to negotiate).
The at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext (SafeGssContextHandle& The context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte [] buffer, Byte [] & amp; OutputBuffer, UInt32 & amp; OutFlags, Int32 & amp; IsNtlmUsed)
The at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext (SafeFreeNegoCredentials credential, SafeDeleteContext& The context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& OutFlags)
Ats System. The Data. SqlClient. SNI. SNIProxy. GenSspiClientContext (SspiClientContextStatus SspiClientContextStatus, Byte [] receivedBuff, Byte [] & amp; ServerName sendBuff, Byte [])
Ats System. The Data. SqlClient. SNI. TdsParserStateObjectManaged. GenerateSspiClientContext (Byte [] receivedBuff, UInt32 receivedLength, Byte [] & amp; SendBuff, UInt32 & amp; SendLength, Byte [] _sniSpnBuffer)
Ats System. The Data. SqlClient. TdsParser. SNISSPIData (Byte [] receivedBuff, UInt32 receivedLength, Byte [] & amp; SendBuff, UInt32 & amp; SendLength)
System. The Data. SqlClient. SqlException x80131904 (0) : always authenticate using Kerberos. Ensure the Kerberos has had an initialized on the client with 'the kinit and a Service Principal Name has had been registered for the SQL Server to allow the Kerberos authentication.
ErrorCode=InternalError, Exception=Interop + NetSecurityNative + GssApiException: GSSAPI operation failed with error - An invalid status code was supplied (SPNEGO always find mechanisms to negotiate).
The at System.Net.Security.NegotiateStreamPal.GssInitSecurityContext (SafeGssContextHandle& The context, SafeGssCredHandle credential, Boolean isNtlm, SafeGssNameHandle targetName, GssFlags inFlags, Byte [] buffer, Byte [] & amp; OutputBuffer, UInt32 & amp; OutFlags, Int32 & amp; IsNtlmUsed)
The at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext (SafeFreeNegoCredentials credential, SafeDeleteContext& The context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& OutFlags)
Ats System. The Data. SqlClient. SNI. SNIProxy. GenSspiClientContext (SspiClientContextStatus SspiClientContextStatus, Byte [] receivedBuff, Byte [] & amp; ServerName sendBuff, Byte [])
Ats System. The Data. SqlClient. SNI. TdsParserStateObjectManaged. GenerateSspiClientContext (Byte [] receivedBuff, UInt32 receivedLength, Byte [] & amp; SendBuff, UInt32 & amp; SendLength, Byte [] _sniSpnBuffer)
Ats System. The Data. SqlClient. TdsParser. SNISSPIData (Byte [] receivedBuff, UInt32 receivedLength, Byte [] & amp; SendBuff, UInt32 & amp; SendLength)
Ats System. The Data. SqlClient. SqlInternalConnectionTds.. Ctor (DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String, newPassword SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
Ats System. The Data. SqlClient. SqlConnectionFactory. The CreateConnection (DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
Ats System. Data. ProviderBase. DbConnectionFactory. CreatePooledConnection (DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
Ats System. Data. ProviderBase. DbConnectionPool. CreateObject (DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
Ats System. Data. ProviderBase. DbConnectionPool. UserCreateRequest (DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
Ats System. Data. ProviderBase. DbConnectionPool. TryGetConnection (DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& Connection)
Ats System. Data. ProviderBase. DbConnectionPool. TryGetConnection (DbConnection owningObject, TaskCompletionSource ` 1 retry, DbConnectionOptions userOptions, DbConnectionInternal& Connection)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related