简体   繁体   English

SQL Server通过Windows身份验证模式限制对数据库的访问

[英]SQL Server Restrict Access to Database by Windows Authentication Mode

I am facing problem regarding database permissions. 我遇到有关数据库权限的问题。 I have created my database named FCProject . 我已经创建了名为FCProject数据库。 I created a login for that database in SQL Server Management Studio. 我在SQL Server Management Studio中为该数据库创建了登录名。 My login is working fine but all I want to restrict access to FCProject database through users who can log in to SQL Server through Windows authentication mode. 我的登录正常,但我想限制所有可以通过Windows身份验证模式登录SQL Server的用户对FCProject数据库的访问。

Because I want only FC login to be able to view or modify data of FC database in SQL Server Management Studio. 因为我只希望FC登录才能在SQL Server Management Studio中查看或修改FC数据库的数据。

I have tried creating a login through Management Studio. 我尝试通过Management Studio创建登录名。 Is there any problem in creating login? 创建登录名有什么问题吗? Or something else? 或者是其他东西? Please help 请帮忙

You are mixing up two things that should be kept separate here: 您正在混淆应在此处分开的两件事:

  1. A login is on the server level - it gives an account (a Windows account, or a SQL Server specific account) the permission to connect to this server 登录名服务器级别的-它授予帐户(Windows帐户或SQL Server特定帐户)连接到该服务器的权限

  2. Each database can then define user for its own use - based on those logins. 基于这些登录-那么每个数据库都可以定义用户自己使用。

So in your case, what you need to do is to: 因此,对于您而言,您需要做的是:

  1. create a number of logins on the server-level 在服务器级别创建许多登录
  2. create users in your FCLogin database for just those logins FCLogin数据库中为这些登录名创建用户

and then you're fine - only those accounts that you've defined explicitly can access your FCLogin database and use it. 然后就可以了-只有明确定义的帐户才能访问FCLogin数据库并使用它。

See the Stairway to SQL Server security series of articles on SQL Server Central (very well worth registering for their contents!) which explains all the ins and outs in great detail 请参阅SQL Server Central上的Stairway to SQL Server安全性系列文章(非常值得注册其内容!),其中详细介绍了所有内容。

暂无
暂无

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

相关问题 限制Windows身份验证以访问SQL Server数据库 - Restrict windows authentication to access a SQL Server database Windows 身份验证 - 限制 SQL Server 后端访问 - Windows Authentication - Restrict SQL Server Backend Access 在SQL Server的Windows身份验证模式下,密码保护的数据库仍然可见 - Password Protected Database still visible in Windows Authentication Mode in SQL Server 将服务器身份验证设置为 SQL Server 和 Windows 身份验证模式的命令 - Command to set server authentication to SQL Server and Windows authentication mode 如何在具有(或不具有)Windows身份验证模式的情况下使用本地SQL Server数据库设置C#Winforms应用程序? - How to setup my C# Winforms app using local SQL Server database with (or without) Windows authentication mode? 使用Windows身份验证将MS Access链接到SQL Server - Linking MS Access to SQL Server with Windows Authentication 使用 Windows 身份验证和 SQL Server 数据库 - Using Windows Authentication and SQL Server database 使用Windows身份验证连接到SQL Server数据库吗? - Connecting to SQL Server Database with Windows Authentication? SQL Server:服务器主体无法在登录的当前安全上下文/Windows 身份验证下访问数据库 - SQL Server: The server principal is not able to access the database under the current security context / windows authentication for the login SQL 服务器:数据库用户访问模式 - SQL Server: Database User Access Mode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM