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

时间:2024-01-19 15:18:06 

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

标签:sql2005,cmd,shell,开启
0
投稿

猜你喜欢

  • python3 字符串知识点学习笔记

    2023-05-02 16:25:35
  • 详解Python中的Array模块

    2021-11-14 02:14:27
  • 关于使用pyqt弹出消息提示框的问题

    2022-02-15 22:22:01
  • 详解python中的数据类型和控制流

    2022-08-11 14:32:50
  • 一文详解Go语言fmt标准库的常用占位符使用

    2023-08-07 01:57:56
  • 代码讲解Python对Windows服务进行监控

    2023-10-07 10:59:09
  • go语言中的return语句

    2024-05-28 15:22:09
  • js constructor的实际作用分析

    2024-02-25 01:41:31
  • sqlserver 动态创建临时表的语句分享

    2012-01-29 17:54:37
  • Python使用sftp实现传文件夹和文件

    2021-09-30 12:27:37
  • thinkPHP中配置的读取与C方法详解

    2023-11-14 17:12:35
  • opencv python在视屏上截图功能的实现

    2021-04-14 04:00:30
  • 使用php操作xml教程

    2023-06-14 03:10:45
  • 开窗函数有浅入深详解(一)

    2024-01-27 03:43:07
  • 跨浏览器让javascript文件携带图片数据

    2011-03-31 17:12:00
  • python+numpy实现的基本矩阵操作示例

    2023-07-16 13:52:37
  • python如何去除字符串中不想要的字符

    2022-01-05 20:37:46
  • Python 获取指定文件夹下的目录和文件的实现

    2023-12-23 22:44:29
  • Mysql如何对json数据进行查询及修改

    2024-01-14 06:29:56
  • 在网页中显示可拖动月历

    2010-07-13 12:09:00
  • asp之家 网络编程 m.aspxhome.com