zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

怎么才能限制SQLServer只能让指定的机器连接

SQLServer机器连接 怎么 限制 指定 才能 只能
2023-06-13 09:13:53 时间
正在看的ORACLE教程是:怎么才能限制SQLServer只能让指定的机器连接。Q.HowcanIrestrictaccesstomySQLServersothatitonlyallowscertainmachinestoconnect?
(v1.019.10.1998)


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


A.SQLServerhasnobuilt-intools/facilitiestodothis.Italsodoesnothavethefacilitytorunastored-procedureonconnectionthatcouldbewritten/usedtodothis.Thereforeyouhavethefollowingchoices:-

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

1.PuttheSQLServerbehindafirewallandusethattorestrictaccess.Thisisthemostsecureandfunctionalwaytodowhatyouwant.

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

2.WriteyourownODSGatewayandpointtheclientsatthatinsteadoftheSQLServer-theODSGatewaywillthendothechecking.However,thereisnothingstoppingclientsfiguringoutthecorrectSQLclient-configentriestopointstraightattheSQLServer.ThereareexamplesofODScodeintheSQLProgrammersToolkit-availableforfreedownloadfromtheMSwebsite.

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

3.Writeaconstantlyrunning/scheduledstored-procedurethatcheckstherelevantcolumninsysprocesses(net_address),andthenissuesaKILLcommandforanyprocessesthatshouldnotberunning.NotethatthisonlyworksforMACaddresses.Thiswayallowspeopletoconnectandpossiblymakechangesbeforetheyarespottedandkilled.

  写一个存储过程检查sysprocesses中的相应列(net_address)