Windows 7 inetpub wwwroot 只读
在我的 Windows 7 计算机上,除非关闭用户帐户控制,否则 c:\inetpub\wwwroot 不可更新。 这是怎么回事?
On my Windows 7 computer, c:\inetpub\wwwroot is not updateable unless I turn off User Account Control.
What's up with that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这里发生了两件事:
1) WWWROOT 目录默认情况下允许管理员组中的任何人具有完全权限,但对每个人都具有只读权限。
2) 默认情况下,在交互式登录会话中启动的进程不会获取管理员组令牌,即使用户是该组的成员也是如此。为了将该令牌附加到您的流程中,您需要通过用户帐户控制同意提示进行提升。 (如果用户帐户不在管理员组中,您还可以提升进程以拥有管理员令牌,但系统会提示您输入该用户的凭据)
关闭 UAC 设置的建议并不好一——这是一个系统范围的设置,会直接对整个系统的安全产生负面影响。相反,做正确的事情:更改 wwwroot 目录的权限,以授予您的用户帐户完全访问权限。
There are two things going on here:
1) The WWWROOT directory, by default, allows full permissions to anyone in the Administrators group, but read-only permissions to Everyone.
2) Processes started in an interactive login session do not get the Administrators group token by default, even if the user is a member of that group. In order to get that token attached to your process, you need to elevate through a User Account Control consent prompt. (You can also elevate a process to have an Administrators token if the user account isn't in the Administrators group, but you will be prompted for the credentials of a user that does)
The suggestion that you turn down UAC's settings is not a good one -- this is a systemwide setting that directly, and negatively, affects the security of your entire system. Instead, do the right thing: change the permissions on the wwwroot directory to give your user account full access.
加入管理员组并为其设置权限不会禁用 UAC 警报。如果您不想在不关闭 UAC 的情况下看到 UAC 警告,则需要将您的用户直接添加到 wwwroot 文件夹的安全设置中。
Beeing in Administrators group and setting privileges for it will not disable UAC alerts. If you don't want to see UAC warnings without turning UAC off, you need to add your user directly to your wwwroot folder's security settings.
...或者您可以使用 Visual Studio Web Server,或者如果您足够幸运拥有 Visual Studio 2010,您可以使用 IIS Express...
... or you could use the Visual Studio Web Server or if you are lucky enough to have Visual Studio 2010 you could use IIS Express...
面对现实吧,在启用了 UAC 的机器上进行开发将会非常烦人。我把我的设置调到最低,这就是我所能忍受的。
如果我是您,我会将您的 Web 应用程序部署到不同的目录,然后将 IIS 指向该目录。
Face it, development on a machine with UAC enabled is going to be really annoying. I leave mine on the lowest setting at that's about all I can tolerate.
If I were you, I would deploy your web apps to different directory and then point IIS inside that one instead.