如何创建用于基本身份验证的用户帐户?
我想向我的网站添加基本身份验证。我按照 MSDN 文章中的说明进行操作:配置基本身份验证 (IIS 7)
使用用户界面
- 打开 IIS 管理器并导航到您要管理的级别。有关打开 IIS 管理器的信息,请参阅打开 IIS 管理器 (IIS 7) 。有关导航到 UI 中的位置的信息,请参阅 IIS 管理器中的导航 (IIS 7) .
- 在功能视图中,双击身份验证。
- 在身份验证页面上,选择基本身份验证。
- 在操作窗格中,点击启用以使用默认设置的基本身份验证。
- (可选)在操作窗格中,单击编辑以键入默认域和领域。
- 在编辑基本身份验证设置对话框的默认域文本框中,键入默认域或将其留空。登录您网站时未提供域的用户将根据该域进行身份验证。
- 在领域文本框中,输入领域或将其留空。通常,您可以使用与默认域相同的域名值。
- 重要
如果您在领域文本框中输入默认域名,您的内部 Microsoft Windows 域名可能会在用户名和密码质询期间向外部用户公开。- 单击确定关闭编辑基本身份验证设置对话框。
这是我到目前为止所做的:
现在我需要创建一个用于基本身份验证的用户帐户。
有谁知道如何在 IIS 管理器中创建用户?
I'd like to add basic authentication to my website. I followed the instructions in the MSDN article on Configure Basic Authentication (IIS 7)
To use the UI
- Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).
- In Features View, double-click Authentication.
- On the Authentication page, select Basic Authentication.
- In the Actions pane, click Enable to use Basic authentication with the default settings.
- Optionally, in the Actions pane, click Edit to type the default domain and realm.
- In the Edit Basic Authentication Settings dialog box, in the Default domain text box, type a default domain or leave it blank. Users who do not provide a domain when they log on to your site are authenticated against this domain.
- In the Realm text box, type a realm or leave it blank. In general, you can use the same value for the realm name as you used for the default domain.
- Important
If you enter the default domain name in the Realm text box, your internal Microsoft Windows domain name may be exposed to external users during the user name and password challenge.- Click OK to close the Edit Basic Authentication Settings dialog box.
Here's what I've done so far:
Now I need to create a user account for the basic authentication.
Does anyone know how to create users in IIS Manager?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
右键单击计算机并选择“管理”(或转至控制面板 > 管理工具 > 计算机管理),在“本地用户和组”下您可以添加新用户。然后,授予该用户读取托管站点的目录的权限。
注意:创建用户后,请务必编辑用户并删除所有角色。
Right click on Computer and choose "Manage" (or go to Control Panel > Administrative Tools > Computer Management) and under "Local Users and Groups" you can add a new user. Then, give that user permission to read the directory where the site is hosted.
Note: After creating the user, be sure to edit the user and remove all roles.
我知道这是一个非常古老的问题,但我想添加一些我艰难发现的解释(这是n00b信息)。
“基本身份验证”共享您在本地计算机或网络上拥有的相同帐户。如果将域和领域留空,则实际使用的是本地帐户。因此,要添加新帐户,请按照将普通新用户帐户添加到本地计算机的确切过程进行操作(如 JoshM 或 此处显示)。如果您输入域和领域,您可以在本地活动目录中创建网络帐户,这些帐户将用于登录和注销用户。
因为它已经存在了很长时间,所以基本身份验证通常与任何浏览器/系统兼容,但它确实存在重大缺陷:
有关基本身份验证或用户帐户的详细信息,请参阅以下内容MSDN 页面。
I know this is a really old question but I wanted to add a bit of explanation that I discovered the hard way (this is n00b information).
"Basic Authentication" shares the same accounts that you have on your local computer or network. If you leave the domain and realm empty, local accounts are what are actually being used. So to add a new account you follow the exact process you would for adding a normal new user account to your local computer (as answered by JoshM or shown here). If you enter a domain and realm you can create network accounts in your local active directory and these are what will be used to log the user in and out.
Because it has been around for so long, basic authentication is generally compatible with any browser/system out there but it does have to major flaws:
For more information about basic authentication or user accounts see the following MSDN page.
我能够在 Windows Server 2012 上实现基本身份验证,执行以下操作:
在 IIS 中选择您的站点,然后选择身份验证
确保基本身份验证是唯一启用的选项
然后!通过服务器管理器添加用户名和密码。
选择工具 -> 计算机管理
在系统工具下 -> 本地用户和组 -> 用户右键单击中间窗格中的任意位置,选择新用户..,然后填写您要使用的凭据。
,当您在浏览器中导航到该站点时,您应该会收到一个身份验证对话框提示:
I was able to achieve Basic Authentication on Windows Server 2012 doing the following:
Select your site within IIS and choose Authentication
Ensure Basic Authentication is the only enabled option
THEN! Add a username and password via the Server Manager.
Select Tools -> Computer Management
Under System Tools -> Local Users and Groups -> Users right-click anywhere in the middle pane, choose New User.. then fill in the credentials you want to use.
Now when you navigate to the site in the browser you should get prompted with an authentication dialog:
如果您使用高级用户管理创建用户(从命令行:
netplwiz
),则修改组、删除用户并添加 iis_users。他们将能够对您的网页进行身份验证,但不能对计算机进行身份验证。If you create a user with the advanced user management (from command line:
netplwiz
), then modify the group, remove users, and add iis_users. They will be able to authenticate to your web page, but not the computer.不幸的是,对于安装在 Windows 7/8 计算机上的 IIS,没有选项可以创建仅用于 IIS 身份验证的用户。
对于 Windows Server,您可以通过该选项从 IIS 管理器 UI 添加用户。这些用户仅在 IIS 上具有角色,但在系统的其余部分没有角色。
在本文中它展示了如何您添加用户,但它也适用于标准操作系统是不正确的,它仅适用于服务器版本。
Unfortunatelly, for IIS installed on Windows 7/8 machines, there is no option to create users only for IIS authentification.
For Windows Server there is that option where you can add users from IIS Manager UI. These users have roles only on IIS, but not for the rest of the system.
In this article it shows how you add users, but it is incorrect stating that is also appliable to standard OS, it only applies to server versions.
在我看来,Windows 8 和 IIS 7 不再提供任何 UI 来创建不是 Windows 本地用户帐户的基本身份验证的用户名和密码。显然,创建仅 IIS 的用户/密码身份验证对是一种优越的方法,但其具体实现方式并不清晰且简单。
命令行工具就是为此目的而存在的。有些人创建一个 Windows 帐户,然后删除本地登录用户权限。
It looks to me like Windows 8 and IIS 7 no longer provides any UI to create a user name and password for basic authentication that is NOT a windows local user account. It is clearly a superior approach to create an IIS-only user/password authentication pair, but it is not clear and easy how it is done.
Command line tools exist for this purpose. Some people create a Windows account and then remove the Log on Locally User Privilege.
使用 microsoft。但对于默认域名,请键入您的计算机名称。要查找您的计算机名称,请单击“开始”,右键单击“计算机”,单击“属性”,然后在其中搜索您的计算机名称 :)
接下来,像在 Windows 7 上通常执行的操作一样创建用户。或者如果您不知道如何执行此操作,进入控制面板,用户,添加帐户......等等等等......明白了吗?
接下来进入iis并为刚刚创建的用户设置权限。请小心设置权限,使其完全符合您的要求。
就这样!输入用户名和密码即可登录!
注意:用户名应该是简单的字母,而不是大写。我对此不太确定,所以我才告诉你这个。
Configure basic authentication using the instructions from microsoft. But for the Default Domain Name, type your computer name. To find your computer name, click start, right-click computer, click properties, and search for your computer name there :)
Next, create users like you would normally do on windows 7. or if you don't know how to do it, go control-panel, users, add account.....blah blah blah.... Get It?
Next go to iis and set permissions for the user you just created. Be carefull to set the permissions to make it exactly how you want it.
That's all! To login, the username and password!
NOTE: The username should be simple letters, not capital. I'm not sure about this, that's why i told you this.
只是添加一个注释,因为没有 50 多个代表我无法发表评论...
如果您在服务器上启用了 FIPS,则它不允许您创建用户。因为 IIS v8(以及我想象的更低版本)不使用 FIPS 加密算法。如果它支持的话那就太好了,因为显然与映射到隔离文件夹的虚拟用户相比,Windows 中的用户帐户是不安全的。太糟糕了。
Just to add a note, since I can't comment without 50+ rep...
If you have FIPS enabled on the server, it doesn't allow you to create users. Because IIS v8 (and lower I would imagine) does not use FIPS encryption algorithms. It would be great if it supported it , because obviously a user account in windows is insecure compared to a virtual user mapped to an isolated folder. Too bad.
在 iis 管理器中单击要保护的目录。
选择授权规则。
添加拒绝匿名用户规则。
添加允许所有用户规则。
返回:“在 iis 管理器中单击要保护的目录”
单击身份验证禁用除基本身份验证之外的所有身份验证。
该目录现在已受到保护。只有拥有用户帐户的人才能通过网络访问该文件夹。
in iis manager click directory to protect.
choose authorization rules.
add deny anonymous users rule.
add allow all users rule.
go back to: "in iis manager click directory to protect"
click authentication disable all except basic authentication.
the directory is now protected. only people with user accounts can access the folder over the web.
@Colin
“本地用户和组”是Windows身份验证
@Colin
"Local Users and Groups" is windows authentication