首页 > 数据库 > SQL Server > 正文

怎样才能限制SQL Server只能让指定的机器连接

2024-08-31 00:49:26
字体:
来源:转载
供稿:网友


q. how can i restrict access to my sql server so that it only allows certain machines to connect?
(v1.0 19.10.1998)


怎样才能限制我的sql server只能让指定的机器连接


a. sql server has no built-in tools/facilities to do this. it also does not have the facility to run a stored-procedure on connection that could be written/used to do this. therefore you have the following choices :-

   sql server没有这样的功能,也没有提供在连接时执行某一特定过程的功能。这里介绍几种实现的方法

1. put the sql server behind a firewall and use that to restrict access. this is the most secure and functional way to do what you want.

    使用防火墙,它提供了安全和你想用的工具。

2. write your own ods gateway and point the clients at that instead of the sql server - the ods gateway will then do the checking. however, there is nothing stopping clients figuring out the correct sql client-config entries to point straight at the sql server. there are examples of ods code in the sql programmers toolkit - available for free download from the ms website.

    写自己的ods网关代替sql server的客户端 - 在ods网关中检查。不过,这并不能停止正常的客户端连接sql server。在sql programmers toolkit中有一个这样的例, 可以从微软站点免费下载。

3. write a constantly running/scheduled stored-procedure that checks the relevant column in sysprocesses (net_address), and then issues a kill command for any processes that should not be running. note that this only works for mac addresses. this way allows people to connect and possibly make changes before they are spotted and killed.

    写一个存储过程检查sysprocesses中的相应列(net_address)
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表