Sql server allow windows firewall что это

Configure a Windows Firewall for Database Engine Access

Applies to: SQL Server (all supported versions)

This topic describes how to configure a Windows firewall for Database Engine access in SQL Server by using SQL Server Configuration Manager. Firewall systems help prevent unauthorized access to computer resources. To access an instance of the SQL Server Database Engine through a firewall, you must configure the firewall on the computer running SQL Server to allow access.

For more information about the default Windows firewall settings, and a description of the TCP ports that affect the Database Engine, Analysis Services, Reporting Services, and Integration Services, see Configure the Windows Firewall to Allow SQL Server Access. There are many firewall systems available. For information specific to your system, see the firewall documentation.

The principal steps to allow access are:

Configure the Database Engine to use a specific TCP/IP port. The default instance of the Database Engine uses port 1433, but that can be changed. The port used by the Database Engine is listed in the SQL Server error log. Instances of SQL Server Express, SQL Server Compact, and named instances of the Database Engine use dynamic ports. To configure these instances to use a specific port, see Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager).

Configure the firewall to allow access to that port for authorized users or computers.

The SQL Server Browser service lets users connect to instances of the Database Engine that are not listening on port 1433, without knowing the port number. To use SQL Server Browser, you must open UDP port 1434. To promote the most secure environment, leave the SQL Server Browser service stopped, and configure clients to connect using the port number.

By default, Microsoft Windows enables the Windows Firewall, which closes port 1433 to prevent Internet computers from connecting to a default instance of SQL Server on your computer. Connections to the default instance using TCP/IP are not possible unless you reopen port 1433. The basic steps to configure the Windows firewall are provided in the following procedures. For more information, see the Windows documentation.

As an alternative to configuring SQL Server to listen on a fixed port and opening the port, you can list the SQL Server executable (Sqlservr.exe) as an exception to the blocked programs. Use this method when you want to continue to use dynamic ports. Only one instance of SQL Server can be accessed in this way.

In This Topic

Before you begin:

To configure a Windows Firewall for Database Engine access, using:

Before You Begin

Security

Opening ports in your firewall can leave your server exposed to malicious attacks. Make sure that you understand firewall systems before you open ports. For more information, see Security Considerations for a SQL Server Installation

Using SQL Server Configuration Manager

Applies to Windows Vista, Windows 7, and Windows Server 2008

The following procedures configure the Windows Firewall by using the Windows Firewall with Advanced Security Microsoft Management Console (MMC) snap-in. The Windows Firewall with Advanced Security only configures the current profile. For more information about the Windows Firewall with Advanced Security, see Configure the Windows Firewall to Allow SQL Server Access

To open a port in the Windows firewall for TCP access

On the Start menu, click Run, type WF.msc, and then click OK.

In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.

In the Rule Type dialog box, select Port, and then click Next.

In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine, such as 1433 for the default instance. Click Next.

In the Action dialog box, select Allow the connection, and then click Next.

In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.

In the Name dialog box, type a name and description for this rule, and then click Finish.

To open access to SQL Server when using dynamic ports

On the Start menu, click Run, type WF.msc, and then click OK.

In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.

In the Rule Type dialog box, select Program, and then click Next.

In the Program dialog box, select This program path. Click Browse, and navigate to the instance of SQL Server that you want to access through the firewall, and then click Open. By default, SQL Server is at C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe. Click Next.

In the Action dialog box, select Allow the connection, and then click Next.

In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.

In the Name dialog box, type a name and description for this rule, and then click Finish.

Настройка правил брандмауэра перед запуском отладчика TSQL Configure firewall rules before running the TSQL Debugger

Применимо к: Applies to: SQL Server SQL Server (все поддерживаемые версии) SQL Server SQL Server (all supported versions) Применимо к: Applies to: SQL Server SQL Server (все поддерживаемые версии) SQL Server SQL Server (all supported versions)

Необходимо настроить правила брандмауэра Windows, включив отладку Transact-SQL Transact-SQL при подключении к экземпляру компонента Компонент Database Engine Database Engine , который работает на компьютере, отличном от того, на котором работает редактор запросов компонента Компонент Database Engine Database Engine . Windows Firewall rules must be configured to enable Transact-SQL Transact-SQL debugging when connected to an instance of the Компонент Database Engine Database Engine that is running on a different computer than the Компонент Database Engine Database Engine Query Editor.

Читайте также:  Microsofthost exe грузит процессор windows 10

Эта функция работает с SSMS версии 17.9.1 и предшествующими версиями. This feature works with SSMS version 17.9.1 and earlier.

Настройка отладчика Transact-SQL Configuring the Transact-SQL Debugger

Отладчик Transact-SQL Transact-SQL имеет как серверные, так и клиентские компоненты. The Transact-SQL Transact-SQL debugger includes both server-side and client-side components. Серверные компоненты отладчика устанавливаются с каждым экземпляром ядра СУБД из SQL Server 2005 (9.x) SQL Server 2005 (9.x) с пакетом обновления 2 (SP2) или более поздней версии. The server-side debugger components are installed with each instance of the Database Engine from SQL Server 2005 (9.x) SQL Server 2005 (9.x) Service Pack 2 (SP2) or later. Клиентские компоненты отладчика устанавливаются в следующих случаях: The client-side debugger components are included:

При установке клиентских средств из SQL Server 2008 SQL Server 2008 или более поздней версии. When you install the client-side tools from SQL Server 2008 SQL Server 2008 or later.

При установке среды Microsoft Visual Studio 2010 или более поздней версии. When you install Microsoft Visual Studio 2010 or later.

При установке среды SQL Server Data Tools (SSDT) SQL Server Data Tools (SSDT) из веб-загрузки. When you install SQL Server Data Tools (SSDT) SQL Server Data Tools (SSDT) from the web download.

Нет требований по конфигурации для запуска отладчика Transact-SQL Transact-SQL , если среда SQL Server Management Studio SQL Server Management Studio или SQL Server Data Tools SQL Server Data Tools работает на том же компьютере, что и экземпляр компонента Компонент SQL Server Database Engine SQL Server Database Engine . There are no configuration requirements to run the Transact-SQL Transact-SQL debugger when SQL Server Management Studio SQL Server Management Studio or SQL Server Data Tools SQL Server Data Tools is running on the same computer as the instance of the Компонент SQL Server Database Engine SQL Server Database Engine . Однако для запуска отладчика Transact-SQL Transact-SQL при соединении с удаленным экземпляром компонента Компонент Database Engine Database Engine для брандмауэра Windows на обоих компьютерах должны быть включены правила программы и порта. However, to run the Transact-SQL Transact-SQL debugger when connected to a remote instance of the Компонент Database Engine Database Engine , program and port rules in the Windows Firewall must be enabled on both computers. Эти правила можно создать в программе установки SQL Server SQL Server . These rules may be created by SQL Server SQL Server setup. Если при попытке открыть сеанс отладки на удаленном компьютере возникают ошибки, убедитесь, что на брандмауэре вашего компьютера определены следующие правила. If you get errors attempting to open a remote debugging session, ensure the following firewall rules are defined on your computer.

Правила можно задать с помощью приложения Брандмауэр Windows в режиме повышенной безопасности . Use the Windows Firewall with Advanced Security application to manage the firewall rules. В Windows 7 Windows 7 и Windows Server 2008 R2 Windows Server 2008 R2 откройте Панель управления и Брандмауэр Windows и выберите Дополнительные параметры. In both Windows 7 Windows 7 and Windows Server 2008 R2 Windows Server 2008 R2 , open Control Panel, open Windows Firewall, and select Advanced settings. В Windows Server 2008 R2 Windows Server 2008 R2 можно также открыть Диспетчер служб, развернуть узел Конфигурация на панели слева и развернуть Брандмауэр Windows в режиме повышенной безопасности. In Windows Server 2008 R2 Windows Server 2008 R2 you can also open Service Manager, expand Configuration in the left pane, and expand Windows Firewall with Advanced Security.

Добавление правил в брандмауэр Windows может подвергнуть компьютер угрозам безопасности, которые брандмауэр должен блокировать. Enabling rules in the Windows Firewall may expose your computer to security threats that the firewall is designed to block. Включение правил для удаленной отладки заключается в разблокировании портов и программ, перечисленных в данном разделе. Enabling rules for remote debugging unblocks the ports and programs listed in this topic.

Правила брандмауэра на сервере Firewall Rules on the Server

На компьютере, где установлен экземпляр компонента Компонент Database Engine Database Engine , через пункт Брандмауэр Windows в режиме повышенной безопасности задайте следующие параметры. On the computer that is running the instance of the Компонент Database Engine Database Engine , use Windows Firewall with Advanced Security to specify the following information:

Добавьте правило входящего соединения для программы sqlservr.exe. Add an inbound program rule for sqlservr.exe. Необходимо иметь правила для каждого экземпляра, к которому должны поддерживаться сеансы удаленной отладки. You must have a rule for each instance that needs to support remote debugging sessions.

На левой панели окна Брандмауэр Windows в режиме повышенной безопасности щелкните правой кнопкой мыши раздел Правила для входящих подключений и выберите на панели действий пункт Создать правило . In Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

В диалоговом окне Тип правила выберите Программа и нажмите кнопку Далее. In the Rule Type dialog, select Program, and then click Next.

В диалоговом окне Программа выберите элемент Путь к этой программе и введите полный путь к файлу sqlservr.exe для данного экземпляра. In the Program dialog, select This program path: and enter the full path to sqlservr.exe for this instance. По умолчанию программа sqlservr.exe устанавливается в папку C:\Program Files\Microsoft SQL Server\MSSQL13.имя_экземпляра\MSSQL\Binn, где имя_экземпляра — это MSSQLSERVER для экземпляра по умолчанию и имя любого именованного экземпляра. By default, sqlservr.exe is installed in C:\Program Files\Microsoft SQL Server\MSSQL13.InstanceName\MSSQL\Binn, where InstanceName is MSSQLSERVER for the default instance, and the instance name for any named instance.

В диалоговом окне Действие выберите Разрешить соединение и нажмите кнопку Далее. In the Action dialog, select Allow the connection, and click Next.

В диалоговом окне Профиль выберите профили, описывающие среду соединения для компьютера, с которым необходимо установить сеанс отладки для экземпляра, и нажмите кнопку Далее. In the Profile dialog, select any profiles that describe the computer connection environment when you want to open a debugging session with the instance, and click Next.

Читайте также:  Усиление звука наушников windows 10

В диалоговом окне Имя введите имя и описание для этого правила, затем нажмите кнопку Готово. In the Name dialog, type a name and description for this rule and click Finish.

В списке Правила для входящих подключений щелкните правой кнопкой мыши созданное правило и выберите пункт Свойства на панели действий. In the Inbound Rules list, right click the rule you created, and then select Properties in the action pane.

Откройте вкладку Протоколы и порты . Select the Protocols and Ports tab.

В поле Тип протокола выберите TCP , в поле Локальный порт выберите Динамические порты RPC , нажмите кнопку Применить, а затем — кнопку ОК. Select TCP in the Protocol type: box, select RPC Dynamic Ports in the Local port: box, click Apply, and then click OK.

Добавьте правило входящего подключения для программы svchost.exe, чтобы обеспечить обмен данными DCOM из сеансов удаленного отладчика. Add an inbound program rule for svchost.exe to enable DCOM communications from remote debugger sessions.

На левой панели окна Брандмауэр Windows в режиме повышенной безопасности щелкните правой кнопкой мыши раздел Правила для входящих подключений и выберите на панели действий пункт Создать правило . In Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

В диалоговом окне Тип правила выберите Программа и нажмите кнопку Далее. In the Rule Type dialog, select Program, and then click Next.

В диалоговом окне Программа щелкните Путь к этой программе и введите полный путь к файлу svchost.exe. In the Program dialog, select This program path: and enter the full path to svchost.exe. По умолчанию в svchost.exe устанавливается по пути %systemroot%\System32\svchost.exe. By default, svchost.exe is installed in %systemroot%\System32\svchost.exe.

В диалоговом окне Действие выберите Разрешить соединение и нажмите кнопку Далее. In the Action dialog, select Allow the connection, and click Next.

В диалоговом окне Профиль выберите профили, описывающие среду соединения для компьютера, с которым необходимо установить сеанс отладки для экземпляра, и нажмите кнопку Далее. In the Profile dialog, select any profiles that describe the computer connection environment when you want to open a debugging session with the instance, and click Next.

В диалоговом окне Имя введите имя и описание для этого правила, затем нажмите кнопку Готово. In the Name dialog, type a name and description for this rule and click Finish.

В списке Правила для входящих подключений щелкните правой кнопкой мыши созданное правило и выберите пункт Свойства на панели действий. In the Inbound Rules list, right click the rule you created, and then select Properties in the action pane.

Откройте вкладку Протоколы и порты . Select the Protocols and Ports tab.

В поле Тип протокола выберите TCP , в поле Локальный порт выберите Сопоставитель конечных точек RPC , нажмите кнопку Применить, а затем — кнопку ОК. Select TCP in the Protocol type: box, select RPC Endpoint Mapper in the Local port: box, click Apply, and then click OK.

Если согласно политике домена требуется, чтобы сетевые соединения осуществлялись через протокол IPsec, то необходимо также добавить правила входящих подключений для открытия портов 4500 и 500 по протоколу UDP. If the domain policy requires network communications to be done through IPsec, you must also add inbound rules opening UDP port 4500 and UDP port 500.

Правила брандмауэра на клиенте Firewall Rules on the Client

На компьютере, где запущен редактор запросов компонента Компонент Database Engine Database Engine , программа установки SQL Server или среды SQL Server Data Tools SQL Server Data Tools могла уже настроить брандмауэр Windows, разрешив удаленную отладку. On the computer that is running the Компонент Database Engine Database Engine Query Editor, the SQL Server setup or SQL Server Data Tools SQL Server Data Tools setup may have configured the Windows Firewall to allow remote debugging.

Если возникают ошибки при попытке открытия сеанса удаленной отладки, то вы можете вручную настроить исключения для программ и портов, настроив правила брандмауэра в окне Брандмауэр Windows в режиме повышенной безопасности . If you get errors attempting to open a remote debugging session, you can manually configure the program and port exceptions by using Windows Firewall with Advanced Security to configure firewall rules:

Добавление записи для программы svchost Add a program entry for svchost:

На левой панели окна Брандмауэр Windows в режиме повышенной безопасности щелкните правой кнопкой мыши раздел Правила для входящих подключений и выберите на панели действий пункт Создать правило . In Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

В диалоговом окне Тип правила выберите Программа и нажмите кнопку Далее. In the Rule Type dialog, select Program, and then click Next.

В диалоговом окне Программа щелкните Путь к этой программе и введите полный путь к файлу svchost.exe. In the Program dialog, select This program path: and enter the full path to svchost.exe. По умолчанию в svchost.exe устанавливается по пути %systemroot%\System32\svchost.exe. By default, svchost.exe is installed in %systemroot%\System32\svchost.exe.

В диалоговом окне Действие выберите Разрешить соединение и нажмите кнопку Далее. In the Action dialog, select Allow the connection, and click Next.

В диалоговом окне Профиль выберите профили, описывающие среду соединения для компьютера, с которым необходимо установить сеанс отладки для экземпляра, и нажмите кнопку Далее. In the Profile dialog, select any profiles that describe the computer connection environment when you want to open a debugging session with the instance, and click Next.

В диалоговом окне Имя введите имя и описание для этого правила, затем нажмите кнопку Готово. In the Name dialog, type a name and description for this rule and click Finish.

В списке Правила для входящих подключений щелкните правой кнопкой мыши созданное правило и выберите пункт Свойства на панели действий. In the Inbound Rules list, right click the rule you created, and then select Properties in the action pane.

Откройте вкладку Протоколы и порты . Select the Protocols and Ports tab.

В поле Тип протокола выберите TCP , в поле Локальный порт выберите Сопоставитель конечных точек RPC , нажмите кнопку Применить, а затем — кнопку ОК. Select TCP in the Protocol type: box, select RPC Endpoint Mapper in the Local port: box, click Apply, and then click OK.

Читайте также:  Tuxera ntfs для mac os

Добавление записи для размещения приложения, в котором размещается редактор запросов Компонент Database Engine Database Engine . Add a program entry for the application hosting the Компонент Database Engine Database Engine Query Editor. Если необходимо открывать сеансы удаленной отладки как из среды SQL Server Management Studio SQL Server Management Studio , так и из среды SQL Server Data Tools SQL Server Data Tools на том же компьютере, то необходимо добавить оба правила. If you need to open remote debugging sessions from both SQL Server Management Studio SQL Server Management Studio and SQL Server Data Tools SQL Server Data Tools on the same computer, you must add a program rule for both:

На левой панели окна Брандмауэр Windows в режиме повышенной безопасности щелкните правой кнопкой мыши раздел Правила для входящих подключений и выберите на панели действий пункт Создать правило . In Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then select New Rule in the action pane.

В диалоговом окне Тип правила выберите Программа и нажмите кнопку Далее. In the Rule Type dialog, select Program, and then click Next.

В диалоговом окне Программа щелкните Путь к этой программе и введите одно из следующих трех значений. In the Program dialog, select This program path: and enter one of these three values.

Для среды SQL Server Management Studio SQL Server Management Studio введите полный путь к ssms.exe. For SQL Server Management Studio SQL Server Management Studio , enter the full path to ssms.exe. По умолчанию программа ssms.exe устанавливается в папку C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\Management Studio. By default, ssms.exe is installed in C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\Management Studio.

Для среды SQL Server Data Tools SQL Server Data Tools введите полный путь к devenv.exe. For SQL Server Data Tools SQL Server Data Tools enter the full path to devenv.exe:

По умолчанию devenv.exe для Visual Studio 2010 устанавливается в папку «C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE». By default, the devenv.exe for Visual Studio 2010 is in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE.

По умолчанию devenv.exe для Visual Studio 2012 устанавливается в папку «C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE». By default, the devenv.exe for Visual Studio 2012 is in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE

Путь к ssms.exe вы можете получить из ярлыка, который используется для запуска среды SQL Server Management Studio SQL Server Management Studio . You can find the path to ssms.exe from the shortcut you use to launch SQL Server Management Studio SQL Server Management Studio . Путь к devenv.exe вы можете получить из ярлыка, который используется для запуска среды SQL Server Data Tools SQL Server Data Tools . You can find the path to devenv.exe from the shortcut you use to launch SQL Server Data Tools SQL Server Data Tools . Щелкните ярлык правой кнопкой мыши и выберите пункт Свойства. Right click the shortcut and select Properties. Исполняемый файл и пути указаны в поле Цель . The executable and path are listed in the Target box.

В диалоговом окне Действие выберите Разрешить соединение и нажмите кнопку Далее. In the Action dialog, select Allow the connection, and click Next.

В диалоговом окне Профиль выберите профили, описывающие среду соединения для компьютера, с которым необходимо установить сеанс отладки для экземпляра, и нажмите кнопку Далее. In the Profile dialog, select any profiles that describe the computer connection environment when you want to open a debugging session with the instance, and click Next.

В диалоговом окне Имя введите имя и описание для этого правила, затем нажмите кнопку Готово. In the Name dialog, type a name and description for this rule and click Finish.

В списке Правила для входящих подключений щелкните правой кнопкой мыши созданное правило и выберите пункт Свойства на панели действий. In the Inbound Rules list, right click the rule you created, and then select Properties in the action pane.

Откройте вкладку Протоколы и порты . Select the Protocols and Ports tab.

В поле Тип протокола выберите TCP , в поле Локальный порт выберите Динамические порты RPC , нажмите кнопку Применить, а затем — кнопку ОК. Select TCP in the Protocol type: box, select RPC Dynamic Ports in the Local port: box, click Apply, and then click OK.

Требования к запуску отладчика Requirements for Starting the Debugger

Все попытки запустить отладчик Transact-SQL Transact-SQL должны также отвечать следующим требованиям. All attempts to start the Transact-SQL Transact-SQL debugger must also meet the following requirements:

SQL Server Management Studio SQL Server Management Studio или SQL Server Data Tools SQL Server Data Tools должна быть запущена под учетной записью, которая является членом предопределенной роли сервера sysadmin. or SQL Server Data Tools SQL Server Data Tools must be running under a Windows account that is a member of the sysadmin fixed server roll.

Окно редактора запросов компонента Компонент Database Engine Database Engine должно быть подключено с помощью имени входа для проверки подлинности Windows или SQL Server SQL Server , которое является членом предопределенной роли сервера sysadmin. The Компонент Database Engine Database Engine Query Editor window must be connected by using either a Windows Authentication or SQL Server SQL Server Authentication login that is a member of the sysadmin fixed server role.

Окно редактора запросов компонента Компонент Database Engine Database Engine должно быть подключено к экземпляру компонента Компонент Database Engine Database Engine из SQL Server 2005 (9.x) SQL Server 2005 (9.x) с пакетом обновления 2 (SP2) или более поздней версии. The Компонент Database Engine Database Engine Query Editor window must be connected to an instance of the Компонент Database Engine Database Engine from SQL Server 2005 (9.x) SQL Server 2005 (9.x) Service Pack 2 (SP2) or later. Когда окно редактора запросов подключено к экземпляру, работающему в однопользовательском режиме, отладчик запустить невозможно. You cannot run the debugger when the Query Editor window is connected to an instance that is in single-user mode.

Сервер должен обмениваться данными с клиентом через RPC. The server needs to communicate back to the client via RPC. Учетная запись, под которой запущена служба SQL Server, должна иметь разрешения на проверку подлинности для клиента. The account under which SQL Server service is running must have authenticated permissions to the client

Оцените статью