1
votes

So I'm trying to connect to one of our SQL server from a RHEL Server 7.4 machine, I already installed Kerberos, unixODBC and Microsoft ODBC for Linux.

The SQL server I'm trying to connect to is inside Active Directory (AD) domain, I was able to authenticate through that using kinit but still getting SSPI Provider: Server not found in Kerberos database. error.

This is my snippet from terminal:

[RH@localhost /]$ sudo kinit [email protected]
[sudo] password for RH: 
Password for [email protected]: 
[RH@localhost /]$ sqlcmd -E -S MyServer
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : SSPI Provider: Server not found in Kerberos database.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Cannot generate SSPI context.

This is my /etc/krb5.conf:

[libdefaults]
 dns_lookup_realm = false
 ticket_lifetime = 24h
 forwardable = yes
 default_realm = ADS.LOCAL.COM
 default_ccache_name = KEYRING:persistent:%{uid}
 dns_lookup_kdc = true

[domain_realm]
 .ads.local.com = ADS.LOCAL.COM

Thanks in advance!

1
did the answer below work? I am having the same problems? It didn't work for me.. but if it did for you it might mean that my problem is with my krb5.conf file.. but I dont know - Matt Camp

1 Answers

0
votes

Usage of Fully Qualified Host Name (FQHN) of the server should solve the problem. For example:

sqlcmd -E -S MyServer.ADS.LOCAL.COM

And if the issue presists, run kinit without sudo see if it helps.