代码之家  ›  专栏  ›  技术社区  ›  Chad

SQL Server:如何拒绝用户访问链接服务器

  •  4
  • Chad  · 技术社区  · 14 年前

    我想拒绝对一组用户的查询链接服务器的访问。我已将它们置于角色中,并为该组分配了对象级权限的某些权限。在搜索了bol和'net之后,我茫然不知如何拒绝访问链接服务器。

    编辑:

    我决定使用profiler来验证在显示链接服务器时SSMS究竟在调用什么,并确保在该系统视图/sp上发出了拒绝。结果它调用了sys.server s,但SQL Server不遵守该系统视图上的acl——这对其他系统视图(例如:sys.dm_db_index_physical_s t a t s)也是如此。

    5 回复  |  直到 5 年前
        1
  •  6
  •   Remus Rusanu    14 年前

    引用链接服务器的afaik不受访问控制列表(acls)控制。换句话说,您不能授予/拒绝/撤销 使用 链接服务器。您当然可以控制 改变 链接服务器通过 ALTER ANY LINKED SERVER 许可。

    这种明显的权限不足是因为链接服务器正在将特定凭据转发到远程服务器,并通过与链接服务器关联的模拟或远程登录设置进行控制。实际的访问控制发生在远程服务器上,使用与链接服务器关联的凭据。因此,为了拒绝一组用户访问链接服务器,需要拒绝该组对远程服务器的访问 在远程服务器上 .

        2
  •  6
  •   Miha    10 年前

    这里有一个我刚刚想到的解决方法:

    在“链接服务器属性”对话框的“属性”选项卡上;添加 不要 want to access the linked server. Then, assign them some dummy user/pass combination that will be rejected on target server.

        3
  •  0
  •   bjorsig    14 年前

    The type of authentication is of importance. When you link the servers they have to be linked using Kerberos and then you can control the access on the linked server. Otherwise your group will always be authenticated on the credentials specified in the link.

        4
  •  0
  •   user1443098    9 年前

    1. 创建用于连接到远程服务器的凭据
    2. 新建链接服务器: a.将服务器角色、AD组或安全性指定为本地用户 b.将凭证指定为远程用户
    3. 向服务器角色或AD组添加登录名以控制访问。
        5
  •  0
  •   john    5 年前

    获取Transact语句,将其放入SSIS包“执行SQL任务”

    In the link server security properties, add the userid (on your server) you want to access the link server to the top section along with the uid and pw for the linked server and click the radio button 'not be made'

    当您在SQLServer代理中安排作业时,选择SSIS包,并在作业步骤中以运行时的行使用代理(DB/安全/证书)。