Friday, March 23, 2012

Login failed for user <DOMAIN>\<MACHINE>$

Folks,

I have read the posts concerning login failures for the ASPNET user. I have a slightly different problem, as you can see from the title of this post.

My environment is a private domain that has two machines:

1) Windows 2000 server on which SQL Server is running. Let's call it FOO_SERVER.

2) Windows XP Professional on which I am running my IIS and .NET development environment. Let's call it FOO_WORK.

3) Let's call the domain, FOO_DOMAIN.

The user, ASPNET, is not a domain user, but a local user, so I do not know how to establish it as a valid login for SQL Server. But this is beside the point, anyway, as the error I am getting has nothing to do with the ASPNET user. It appears that a different username is being used to access SQL Server.

My connection string is:

"server=FOO_SERVER;database=pubs;Trusted_Connection=yes"

The error I receive is:

"Login failed for user FOO_DOMAIN\FOO_WORK$"

I am using the default settings in machine.config. Specifically <processModel> userName="machine" password="AutoGenerate" </processModel
Thanks in advance for any suggestions.

-JoelAre you using mixed mode on your SQL server? If so, you can get rid of the trusted connection, and have user id=sa;pw=; or whatever you want. Good luck.|||Joel,

To get the trusted connection business to work, you're going to need to create an account with the same username and password on the web box and sql box, or on your domain. ASP.Net will need to be configured in the <processmodel> section to run under this account. Of course, proper SQL permissions will have to be granted to the user as well.

Do you happen to have an <identity impersonate="true" /> line in your web.config file?|||Folks,

Thanks to all.

Two different solutions were found to work.

1) Add to the project's web.config file:

<identity impersonate="true" /
This will be required on a project-by-project basis.

2) Modify machine.config:

CHANGE:
<identity impersonate="false" userName="" password=""/
TO:
<identity impersonate="true" userName="" password=""/
This will be a global change, which can be turned off on a project-by-project basis, if necessary, by adding this to a project's web.config file:

<identity impersonate="false" /
I appreciate the help!

-Joel|||I think I got the same issue: Joel can you confirm if I have to do the same thing. I have been pulling my hair out!

Here is my layout

Server1:Machine name:"MyWeb"
Connected to:CompanyDomain (CorpDom)
Connecting using domain user:cooder.

Windows 2003, IIS6,
1st Nic Connected to domain
2nd Nic with Pirvate IP 192.168.1.1

Server2:Machine name:"db_server"

Windows 2003, SQL 2000
1 Nic card with Private static IP 192.168.1.2
DNS pointing to 192.168.1.1

Connected with crossover cable.

Does anyone have information on how to set this up!
How do you get the trusted connection?

So easy setting it up when the DB is on the same machine as asp.net! Help, help please help!

No comments:

Post a Comment