Windows Authentication with SQL Server running on Workgroup server machine



I'm currently trying to understand SQL Server Windows Authentication
ahead of writing an application that needs to connect to SQL server.

The server is a machine named 'databaseserver' that runs SQL Server
Express 2005 in Windows Authentication mode. The server is a Workgroup
computer, not on a domain and therefore has a set of local user
accounts. The account I'm interested in using is called 'databaseuser'
and its password is 'letmein'. 'databaseuser' is included in the user
group 'administrators', so SQL Server will accept connections from it.
If I log into 'databaseserver' using Terminal Services as
'databaseuser', then I can connect fine to the database using SQL
Server Management Studio Express with authentication set to Windows
Authentication and the server name to 'databaseserver\sqlexpress'.

Now, I want to make connections to 'databaseserver' from another
machine named 'databaseclient', but continue to use the 'databaseuser'
account on 'databaseserver'. It's at this point where I start having
problems.

I'm logged in on the 'databaseclient' machine as 'administrator'. If I
then run SQL Server Management Studio Express and set the
authentication to Windows Authentication and the server name to
'databaseserver\sqlexpress', it tells me...

"Login failed for user ''. The user is not associated with a trusted
SQL Server connection. (Microsoft SQL Server, Error: 18452)"

Fine, I'm logged into 'databaseclient' as 'administrator', but the
administrator password is different on 'databaseclient' from that on
'databaseserver', so it can't authenticate. And to be clear,
'databaseclient' doesn't have a local machine account named
'databaseuser' set up.

Next, I authenticate 'databaseclient' (running as administrator) to
'databaseserver' by using the following net command...

net use \\databaseserver
(and enter 'databaseuser' / 'letmein' when prompted)

From this point I can now browse network shares, view performance
counters and view the registry on 'databaseserver' by using Windows
Explorer or the remote machine features of perfmon.msc, or
regedit32.exe.

So, after all that preamble, what I really want to know is why, in
this authenticated state cannot I not now fire up SQL Server
Management Studio Express on 'databaseclient' and connect to
'databaseserver' using Windows Authentication with the already
authenticated 'databaseuser' account?

Once I've authenticated using net use, it seems that other remote
Windows services are happy to trust that connection, so why is any SQL
Server client being difficult about it?

I know that I could create an account named 'databaseuser' with
password 'letmein' on 'databaseclient' and then run SQL Server
Management Studio Express using that account with the Windows 'runas'
command. I've tested it and that works, but it's such a pain because
it means replicating all relevant local user accounts from
'databaseserver' on the client machines.

I really don't want to have to drop back to SQL Server Authentication
just for the SQL Server access, as I wanted to authenticate with one
authentication scheme.

Any thoughts or hints much appreciated.
James

.



Relevant Pages

  • Re: NT authentication vs. SQL auth
    ... that Windows Authentication is more "demanding" than is SQL Server ... I would think that SQL Server, rather than just looking at its own (probably ...
    (microsoft.public.sqlserver.security)
  • Re: NT authentication vs. SQL auth
    ... that Windows Authentication is more "demanding" than is SQL Server ... I would think that SQL Server, rather than just looking at its own (probably ...
    (microsoft.public.sqlserver.security)
  • Re: SBS 2000 + ASP.NET 1.1 + IIS Lockdown not working.
    ... Currently I am using Windows authentication. ... I will try SQL Server ... You can encrypt these string ...
    (microsoft.public.inetserver.iis.security)
  • Re: Need Help w/ SQLServer Express Authentication
    ... Windows Authentication can not be disabled using Mixed Authentication. ... You can only disable SQL Server authentication and Microsoft recommends using Windows Authentication when possible. ... Logins make your users to connect and perform their tasks in SQL Server. ...
    (microsoft.public.sqlserver.setup)
  • Re: Windows Authentication in asp.net 2005 to SQL Server?
    ... If the domains do not trust each other, Windows authentication is not going ... Basic authentication sometimes makes the need for Kerberos delegation go ... generic account to do the backend data stuff on our SQL Server. ...
    (microsoft.public.dotnet.framework.aspnet.security)