SQL Server error 18452: Login is from an untrusted domain
Windows authentication failed: the client's Windows identity couldn't be verified by the server, often a domain trust, Kerberos or local-account problem.
- Error number
18452- Severity
- 14
- Category
- Connection and login
What it means
With Windows (integrated) authentication, SQL Server relies on Windows to vouch for the client. Error 18452 means Windows couldn't authenticate the caller to the server: the account isn't from a domain the server trusts, or the security handshake (Kerberos or NTLM) failed.
Common causes
- The client machine or user is not in the server's domain or a trusted domain, for example a workgroup laptop or a different forest without a trust.
- The server is configured for Windows authentication only and the client tried a SQL login.
- Kerberos problems such as missing or duplicate SPNs, or a clock difference between client and domain controller.
- Connecting by IP address or a DNS alias that doesn't match the server's SPN, so the handshake falls back and fails.
- Loopback protection when connecting to the local machine by a fully qualified name or alias.
How to fix it
-
If you meant to use a SQL login, enable SQL Server and Windows Authentication mode on the server (Properties, Security) and restart the service.
-
Connect from a machine and account in the server's domain or a trusted domain, or create a SQL login for this client.
-
Check the SPNs for the SQL Server service account with
setspn -L <service account>and fix missing or duplicate entries; Microsoft's SQLCheck tool reports these. -
Connect using the server's real host name rather than an IP address or alias.
Related errors
More connection and login errors
4060Cannot open database requested4064Cannot open user default database18470Login failed, account disabled18486Login failed, account locked out18487Login failed, password expired18488Login failed, password must be changed18461Login failed, single user mode
The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.
Work on SQL Server in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.