请教SQL2005Server 系统管理员怎样限制用户使用master的xp_cmdshell存储过程

解决方案 »

  1.   

    configration->surface are configration
      

  2.   

    功能的外围应用配置器->xp_cmdshell ,启用的勾去除 是吗?
    这样可以防止注入吗?
      

  3.   


    SQL Server 2005 中引入的 xp_cmdshell 选项是服务器配置选项,使系统管理员能够控制是否可以在系统上执行 xp_cmdshell 扩展存储过程。默认情况下,xp_cmdshell 选项在新安装的软件上处于禁用状态,但是可以通过使用外围应用配置器工具或运行 sp_configure 系统存储过程来启用它,如下面的代码示例所示:
    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 
      

  4.   

    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 EXEC sp_configure 'show advanced options', 0
    GO
    -- To update the currently configured value for advanced options.
    RECONFIGURE
    GO