简体   繁体   English

创建IIS7用户并允许访问目录?

[英]Create an IIS7 user and allow access to directory?

I am running IIS 7 on Windows Server 2003. I am more of an Apache user, so please forgive me. 我在Windows Server 2003上运行IIS7。我更多地是Apache用户,请原谅我。

I need to password-protect a directory on my server to allow only one user to access it via http. 我需要对服务器上的目录进行密码保护,以仅允许一个用户通过http访问该目录。 A simple 401 challenge is fine. 一个简单的401挑战就可以了。

I've googled this task and they all say to begin double-clicking the "IIS Users" icon in IIS manager. 我已经用谷歌搜索了这个任务,他们都说要开始双击IIS管理器中的“ IIS用户”图标。 I launched IIS manager via RDP and do not see this icon. 我通过RDP启动了IIS管理器,但没有看到此图标。 (see screenshot) (请参见屏幕截图)

So how to proceed? 那么如何进行呢?

If the user existed, I know how to select the directory and allow access only to that user -- so the question is how to make this user. 如果该用户存在,我知道如何选择目录并仅允许该用户访问-因此问题是如何创建该用户。

在此处输入图片说明

You need to create the user under Computer Management and assign the permissions in Windows Explorer. 您需要在“计算机管理”下创建用户,并在Windows资源管理器中分配权限。 All you would need to do in IIS is make sure you have Windows Authentication turned on, and Anonymous Authentication turned off. 在IIS中,您需要做的就是确保已打开Windows身份验证,并且已关闭匿名身份验证。 So, here's the steps: 因此,步骤如下:

  1. Under Control Panel > Administrative Tools > Computer Management. 在控制面板>管理工具>计算机管理下。 Expand Local Users and Groups > Users > Right Click > New User. 展开本地用户和组>用户>右键单击>新用户。

  2. Under Windows Explorer, navigate to the folder you want to secure. 在Windows资源管理器下,导航到要保护的文件夹。 Right click on it > Properties > Security Tab > Edit > Add. 右键单击它>属性>安全选项卡>编辑>添加。 Give your new user at least Read/Execute permissions to the folder. 为您的新用户至少授予对该文件夹的读取/执行权限。

  3. Under IIS, expand on your website and select the folder that you want to protect. 在“ IIS”下,在您的网站上展开,然后选择要保护的文件夹。 Then click the Authentication icon. 然后单击身份验证图标。 Make sure Windows Auth is on and Anon Auth is off. 确保Windows身份验证已打开并且Anon身份验证已关闭。

That should do it. 那应该做。 Your browser should now give you the auth challenge when you try to browse to that folder. 现在,当您尝试浏览到该文件夹​​时,您的浏览器应该给您身份验证挑战。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM