SQL Server 2005的cmd_shell组件的开启方法

sql server中的cmd_shell组件功能强大,几乎可通过该组建实现windows系统的所有功能,正因此,这个组件也是sql server的最大安全隐患。sql server 2000中这个组件是默认开启的,而sql server 2005中这个组件默认作为此服务器安全配置的一部分而被关闭。有时我们需要用到该组件,开启此组件的相关语句如下:

–to allow advanced options to be changed.

exec sp_configure ‘show advanced options’, 1
go

–to update the currently configured value for advanced options.
reconfigure
go — to enable the feature.

exec sp_configure ‘xp_cmdshell’, 1
go
–to update the currently configured value for this feature.
reconfigure
go

为了保证数据库服务器的安全,建议在使用完毕后关闭该组件,关闭该组件的相关语句如下:

–to allow advanced options to be changed.

exec sp_configure ‘show advanced options’, 1
go

–to update the currently configured value for advanced options.
reconfigure
go — to enable the feature.

exec sp_configure ‘xp_cmdshell’, 0
go
–to update the currently configured value for this feature.
reconfigure
go

(0)
上一篇 2022年3月21日
下一篇 2022年3月21日

相关推荐