IIS5 正在 SERVER1 上运行。
IIS 中的虚拟目录之一 myfiles 指向“另一台计算机上的共享位置”,//SERVER2/myfilesshare
当我尝试访问该页面时:
http://SERVER1/myfiles
...我收到错误:
您无权查看此页面< /strong>
HTTP 401.1 - 未经授权:登录失败
Internet 信息服务
我已三重检查 IIS 中的“连接为...”设置。 我用于访问共享的凭据是正确的 - 它们在连接到 Windows 资源管理器中的共享时有效,但不能通过 IIS 虚拟目录。
我尝试向每个人授予对 SERVER2 中文件夹的完全权限,但没有成功。
有什么想法吗?
IIS5 is running on SERVER1.
One of the virtual directories in IIS, myfiles, is pointing to "A shared location on another computer", //SERVER2/myfilesshare
When I try to access the page:
http://SERVER1/myfiles
... I get the error:
You are not authorized to view this page
HTTP 401.1 - Unauthorized: Logon Failed
Internet Information Services
I have triple-checked the "Connect As..." settings in IIS. The credentials I'm using to access the share are correct-- they work when connect to the share in Windows Explorer, but not through the IIS virtual directory.
I've tried granting full permission to Everyone on the folder in SERVER2, but no luck.
Any thoughts?
发布评论
评论(4)
这就是我解决问题的方法,可能对你有帮助。
默认情况下,当使用匿名身份验证时,IIS 使用名为
IUSR
的本地用户作为虚拟目录。 它不使用应用程序身份,如果您使用procmon
,这一点应该是显而易见的。如何强制它使用应用程序身份?
简单,在 IIS 管理器下:
1) 转到“身份验证”
2) 编辑“匿名身份验证”
3) 选择“应用程序池身份”
4) 重新启动 IIS 它应该有效。
使用 PS 完成相同的操作:
Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name username -value ""
此链接包含优点/缺点:http://博客。 technet.com/b/tristank/archive/2011/12/22/iusr-vs-application-pool-identity-why-use-either.aspx
This was how I solved my problem, might help you.
By default, IIS uses local user called
IUSR
for virtual directories when using anonymous authentication. It does not use application identity, which should be obvious, if you useprocmon
.How can you force it to use application identity?
Easy, under IIS manager:
1) go to Authentication
2) Edit "Anonymous authentication"
3) Select "Application pool identity"
4) Restart IIS & it should work.
The same accomplished with PS:
Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name username -value ""
This link contains the pros/cons: http://blogs.technet.com/b/tristank/archive/2011/12/22/iusr-vs-application-pool-identity-why-use-either.aspx
权限问题可能很棘手。 尝试在“其他计算机”上运行 filemon 它可以在此处下载:http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx
(它不是一个大应用程序,只是一个小型轻量级工具)
启动 filemon 后,停止监视进程(我相信启动应用程序时它默认打开),清除记录的数据,为您的文件夹创建一个过滤器无法访问。 启动监控进程。 请求您的网页。 停止监视器进程并在 filemon 中查找“访问被拒绝”消息。 找到后,filemon 还会提及尝试访问的实际用户的名称。 这可能会帮助您找到解决方案。
顺便说一句,当使用 Windows Server 2008 时,您将需要 processmon:http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Permission issues can be tricky. Try running filemon on the 'other computer' It can be downloaded over here: http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx
(it's not a big application just a tiny lightweight tool)
After you've started filemon, stop the monitor process (I believe it's turned on by default when you start the application), clear the logged data, create a filter for the folder you have trouble getting access to. Start the monitor process. Request your webpage. Stop the monitor process and look for "access denied" messages in filemon. When found, filemon will also mention the name of the actual user which is trying to get access. This might help you to get to a solution.
Btw when using Windows Server 2008 you will need processmon instead: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
想象一个场景,无论出于何种原因,您希望 IIS 服务器访问文件服务器上的共享,但它们不在同一域中。
如果您可以遵循并让它为您工作(我已经在 Win2008-R1 32 位文件服务器和 Win2008-R2 64 位与 IIS 7 上完成了),那么您应该在任何情况下都处于良好状态。
aspnet_regiis -ga MyAccount
授予本地帐户对 IIS 内部的访问权限使用将测试/验证的内容。 关键实际上是使用
服务帐户
(域或其他)进行委派的信任,并让 IIS 使用您希望它使用的帐户而不是本地服务器或网络服务。这花了我一整天的时间才弄清楚。 StackOverflow 和其他互联网资源中的各种线索帮助我找到了各种资源,但没有在任何地方找到我的确切答案。 希望下一个遇到这个问题的人能够通过我对对我有用的描述来解决问题。
Imagine a scenario where for whatever reason you want to have your IIS Server access a Share on a File server and they are not on the same domain.
If you can follow and get this to work for you (I have done it Win2008-R1 32-bit File Server and Win2008-R2 64-bit with IIS 7), then you should be in good shape for any scenario.
aspnet_regiis -ga MyAccount
to give local account access to IIS gutsUse something that will test/verify. The key really is trust for delegation using a
Service Account
(domain or otherwise), and having IIS use the account you want it to use instead of Local Server or Network Service.This took me all day to figure out. Various threads in StackOverflow and other Internet sources helped point me to various resources me but didn't find my exact answer anywhere. Hopefully next person stuck with this problem will get a speed boost on the path to resolving with my description of what worked for me.
尝试在虚拟目录安全选项卡(在 IIS 中)上启用 Windows 身份验证。
try enabling windows authentication on the virtual directory security tab (in IIS).