简体   繁体   English

使用 SQL 服务器作为数据库时,如何保护或隐藏后端数据?

[英]How to protect or hide backend data while using SQL server as Database?

Is it possible to hide the databases used in my application from the user.是否可以向用户隐藏我的应用程序中使用的数据库。 What I need is that when user opens SQL Server management studio, he should not see the databases used in my application developed in C# and VB6我需要的是,当用户打开 SQL 服务器管理工作室时,他不应该看到我在 C# 和 VB6 中开发的应用程序中使用的数据库

There are 2 ways to forbid access to db content:有两种方法可以禁止访问数据库内容:

  • Encrypting db content: will decrease performance加密数据库内容:会降低性能
  • Autorisations: you create a user specifically for your application, put it as db owner, and remove access for all users. Autorisations:您专门为您的应用程序创建一个用户,将其作为数据库所有者,并删除所有用户的访问权限。 And also you need to disable Windows Authentication connection in MsSQL server, so that admin cannot connect this way.并且您还需要在 MsSQL 服务器中禁用 Windows 身份验证连接,以便管理员无法通过这种方式连接。

Accessing the database with a user login only gives access to the databases for which that use has been given permission.使用用户登录访问数据库只能访问已被授予权限的数据库。 Different users have access to different databases.不同的用户可以访问不同的数据库。 Perhaps you have 3 users: root, admin, user.也许您有 3 个用户:root、admin、user。

As a start point, try looking at http://msdn.microsoft.com/en-us/library/ms187936.aspx作为起点,请尝试查看http://msdn.microsoft.com/en-us/library/ms187936.aspx

You would need to revoke the permission 'VIEW ANY DATABASE' from the role PUBLIC (SQL SERVER 2005 onwards).From Stackoverflow.您需要从 PUBLIC 角色(从 SQL SERVER 2005 开始)撤销“查看任何数据库”的权限。来自 Stackoverflow。 For more details see a ans Hide SQL database from Management Studio有关更多详细信息,请参阅 ans Hide SQL database from Management Studio

Don't grant the user permission to access the database.不要授予用户访问数据库的权限。 Instead embed credentials in to your program that allow it to access the DB via a dedicated account.而是将凭据嵌入到您的程序中,以允许它通过专用帐户访问数据库。 When the user uses your program the program's user is granted access, but if the user tries connect directly he is denied access.当用户使用你的程序时,程序的用户被授予访问权限,但如果用户尝试直接连接,他将被拒绝访问。

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

相关问题 如何使用C#删除“正在使用”的SQl Server数据库? - How To Delete SQl Server database while it is “In Use” using C#? 如何在不使用复制的情况下将本地 SQL 服务器数据库的数据同步到远程 SQL 服务器? - How to synchronize data from local SQL Server database to remote SQL Server without using replication? 如何将JSON数据存储到SQL Server数据库中? - How to store JSON data into SQL Server database? 如何连接到 SQL SERVER 并将数据插入数据库? - How to connect to SQL SERVER and insert data into database? 如何将数据插入SQL Server数据库 - How to insert Data into sql server database 如何使用 System.Data.SQlite.EF6 对 SQLite 数据库进行密码保护 - How to password protect SQLite Database using System.Data.SQlite.EF6 使用SQL Server数据库发布应用程序时的主要注意事项 - main considerations while publishing application using SQL server Database 如何在SQL Server数据库中更新信息时触发程序? - How to trigger program while update info in SQL Server database? 如何使用sql游标更新sql server数据库中的数据? - How to update data in sql server database with the sql cursor? 如何使用c#将DateTime类型的数据插入SQL Server数据库? - How insert the data with DateTime type into SQL Server database using c#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM