将 ASP.NET MVC 应用程序的 IIS 7.5 应用程序池身份配置为 SQL Server 2008 R2 上的登录名

发布于 2024-10-08 15:17:46 字数 944 浏览 0 评论 0原文

我正在尝试使用 IIS 7.5 应用程序池标识作为 SQL Server 2008 R2 上的登录名,以便我的 ASP.NET Web 应用程序可以连接到数据库...

使用这种方法在我的本地开发计算机上运行良好(IIS 7.5 和 SQL Server 2008 R2 在同一台计算机上)。

但是,当我尝试在生产中设置相同的设置(IIS 和 SQL 服务器是分开的)时,我无法将“IIS APPPOOL\MyAppAppPool”登录添加到 SQL Server 2008 R2。

请注意,在任何一种情况下,在 SQL Server 中创建登录名时都不能使用“浏览...”,因为“IIS APPPOOL\MyAppAppPool”用户身份是动态的(或“特殊”)...

有什么想法吗?

更新:

有关应用程序池标识的详细信息请参见此处

来自文章:

每当有新的应用程序池时 创建、IIS管理进程 创建安全标识符 (SID) 代表的名称 应用程序池本身。例如, 如果您使用以下命令创建应用程序池 名称“MyNewAppPool”,一种证券 带有名称的标识符 “MyNewAppPool”创建于 Windows 安全系统。从这里 就这一点而言,资源可以通过以下方式获得 使用这个身份。然而, 身份不是真实的用户帐户; 它不会显示为用户 Windows 用户管理控制台。

I am trying to use IIS 7.5 Application Pool identity as login on SQL Server 2008 R2 so that my ASP.NET web app can connect to the database...

Using this approach worked fine on my local dev machine (IIS 7.5 and SQL Server 2008 R2 on same machine).

However, when I try to set up the same on production (IIS and SQL servers are separate) I am unable to add "IIS APPPOOL\MyAppAppPool" login to SQL Server 2008 R2.

Notice that in either case you cannot use "Browse..." when creating a login in SQL Server since "IIS APPPOOL\MyAppAppPool" user identity is dynamic (or "special")...

Any ideas?

Update:

For more info on Application Pool Identities see here.

From article:

Whenever a new Application Pool is
created, the IIS management process
creates a security identifier (SID)
that represents the name of the
Application Pool itself. For example,
if you create an Application Pool with
the name "MyNewAppPool," a security
identifier with the name
"MyNewAppPool" is created in the
Windows Security system. From this
point on, resources can be secured by
using this identity. However, the
identity is not a real user account;
it will not show up as a user in the
Windows User Management Console.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惜醉颜 2024-10-15 15:17:46

该文章指出(在“访问网络”下)您仍然使用域中的 \$ 又名计算机帐户。

因此,如果两台服务器都在“foobar”域中,并且 Web 框是“bicycle”,则用于 SQL Server 实例的登录名是 foobar\bicycle$

如果您不在域中,则没有可供验证的公共目录。为了简单起见,使用带有用户名和密码的 SQL 登录名

在评论后进行编辑

如果域受信任,那么您仍然可以使用 machien 帐户(对 SQL Server 使用域本地组,在其中添加全局组等)

至于使用应用程序池身份,根据文章,它们仅位于您的 Web 服务器本地。它们对 SQL Server 没有任何意义。如果您需要区分站点,请为应用程序池使用正确的域帐户。

你不能两全其美...

That articles states (under "Accessing the Network") you still use the <domainname>\<machinename>$ aka machine account in the domain.

So if both servers are in "foobar" domain, and the web box is "bicycle", the login used to the SQL Server Instance is foobar\bicycle$

If you aren't in a domain, then there is no common directory to authenticate against. Use a SQL login with username and password for simplicity

Edit, after comment

If the domains are trusted then you can use the machien account still (use domain local groups for SQL Server, into which add a global groups etc)

As for using app pool identities, they are local to your web server only as per article. They have no meaning to SQL Server. If you need to differentiate sites, then use proper domain accounts for the App Pools.

You can't have it both ways...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文