• 设为首页
  • 收藏本站
  • 积分充值
  • VIP赞助
  • 手机版
  • 微博
  • 微信
    微信公众号 添加方式:
    1:搜索微信号(888888
    2:扫描左侧二维码
  • 快捷导航
    福建二哥 门户 查看主题

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

    发布者: 福建二哥 | 发布时间: 2025-6-18 14:24| 查看数: 75| 评论数: 0|帖子模式

    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


    来源:https://www.jb51.net/article/41667.htm
    免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

    最新评论

    QQ Archiver 手机版 小黑屋 福建二哥 ( 闽ICP备2022004717号|闽公网安备35052402000345号 )

    Powered by Discuz! X3.5 © 2001-2023

    快速回复 返回顶部 返回列表