---
title: "Remove security group from port"
sidebar_label: "Remove security group from port"
sidebar_position: 6
description: "How to remove a security group from a port"
---

import Formbricks from '@theme/MDXComponents/Formbricks';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import { TabItemLabel } from '@selectel/docux/components';
import TrashIcon from '@selectel/docux/icons/trash';
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical';
import CopyIcon from '@selectel/docux/icons/copy';

# Remove security group from port

:::warning

Traffic that was allowed by the group rules will be denied. Active sessions that were established according to the group rules will be terminated on the port.

If you remove all security groups from a port, all traffic on it will be completely blocked.

:::

<Tabs queryString="remove-security-group-from-private-port">
  <TabItem value="private" default>
    <TabItemLabel>
      Private subnet
    </TabItemLabel>

    <Tabs queryString="remove-security-group-from-private-port">
      <TabItem value="panel" default>
        <TabItemLabel>
          Control panel
        </TabItemLabel>

        1. In the [Control panel](https://my.selectel.ru/vpc/default/security-groups), on the top menu, click **Products** and select **Cloud Servers**.

        2. Go to the **Security Groups** section.

        3. Open the page of the group you want to detach → **Ports** tab.

        4. In the port line, click <TrashIcon />.

        5. If the group was the only one on the port, enter the group name to confirm detachment.

        6. Click **Disable**.
      </TabItem>

      <TabItem value="openstack">
        <TabItemLabel>
          OpenStack CLI
        </TabItemLabel>

        1. [Open OpenStack CLI](/cloud-servers/tools/openstack-cli/).

        2. Detach the security group from the port:

           ```
           openstack port unset \
             --security-group <security-group> \
             <port>
           ```

           Specify:

           * `<security_group>` — security group ID or name. You can view the list of security groups using the `openstack security group list`;
           * `<port>` — port ID or name; you can view it using the `openstack port list`. You can view the list of ports the group is assigned to in the [Control panel](https://my.selectel.ru/vpc/default/security-groups): in the top menu, click **Products** → **Cloud Servers** → **Security Groups** → security group page → **Ports**.

        3. Optional: detach all security groups assigned to the port:

           ```
           openstack port set \
             --no-security-group \
             <port>
           ```

           Specify `<port>` — port ID; you can view it using the `openstack port list`.
      </TabItem>
    </Tabs>
  </TabItem>

  <TabItem value="public-subnet">
    <TabItemLabel>
      Public subnet
    </TabItemLabel>

    <Tabs queryString="remove-security-group-from-public-subnet-port">
      <TabItem value="panel">
        <TabItemLabel>
          Control panel
        </TabItemLabel>

        1. In the [Control panel](https://my.selectel.ru/vpc/default/security-groups), in the top menu, click **Products** and select **Cloud Servers**.

        2. Go to the **Security Groups** section.

        3. Open the page of the group you want to disable → **Ports** tab.

        4. In the port line, click <TrashIcon />.

        5. If the group was the only one on the port, enter the group name to confirm detachment.

        6. Click **Disable**.
      </TabItem>

      <TabItem value="openstack">
        <TabItemLabel>
          OpenStack CLI
        </TabItemLabel>

        1. [Open OpenStack CLI](/cloud-servers/tools/openstack-cli/).

        2. Detach the security group from the port:

           ```
           openstack port unset \
             --security-group <security-group> \
             <port>
           ```

           Specify:

           * `<security_group>` — security group ID or name. You can view the list of security groups using the `openstack security group list`;
           * `<port>` — port ID or name; you can view it using the `openstack port list`. You can view the list of ports the group is assigned to in the [Control panel](https://my.selectel.ru/vpc/default/security-groups): in the top menu, click **Products** → **Cloud Servers** → **Security Groups** → security group page → **Ports**.

        3. Optional: detach all security groups assigned to the port:

           ```
           openstack port set \
             --no-security-group \
             <port>
           ```

           Specify `<port>` — port ID; you can view it using the `openstack port list`.
      </TabItem>
    </Tabs>
  </TabItem>

  <TabItem value="direct-public-ip">
    <TabItemLabel>
      Direct public IP address
    </TabItemLabel>

    <Tabs queryString="remove-security-group-from-direct-public-ip-port">
      <TabItem value="panel" default>
        <TabItemLabel>
          Control panel
        </TabItemLabel>

        1. In the [Control panel](https://my.selectel.ru/vpc/default/security-groups), in the top menu, click **Products** and select **Cloud Servers**.

        2. Go to the **Security Groups** section.

        3. Open the page of the group you want to disable → **Ports** tab.

        4. In the port line, click <TrashIcon />.

        5. If the group was the only one on the port, enter the group name to confirm detachment.

        6. Click **Disable**.
      </TabItem>
    </Tabs>
  </TabItem>
</Tabs>

<Formbricks />
