Optionally Configure the Tang Server to Run on a Specified Port

What Do You Need?

  • The Tang package must be installed, and the Tang socket must be enabled in Systemd. See Install the Tang Package and Enable the Tang Socket in Systemd for information on how to do this.

  • In Oracle Linux 10, you need to install the policycoreutils-python-utils package before you can use the SELinux semanage command. You can install the package by running the following command:

    sudo dnf install policycoreutils-python-utils

By default, Tang runs on TCP port 80. If you intend to override this setting to run a Tang server on another port, you must configure SELinux so that Tang works with the required TCP port.

  1. Configure Tang to listen on a chosen TCP port.

    For example, to configure Tang to listen on TCP port 7500, run:

    sudo semanage port -a -t tangd_port_t -p tcp 7500       
  2. Configure a Systemd override so that Tang listens on the chosen port.

    If you have chosen to run Tang on a different port, you must configure a Systemd override by configuring a Socket entry:

    sudo mkdir -p /etc/systemd/system/tangd.socket.d/
    sudo echo | sudo tee /etc/systemd/system/tangd.socket.d/port.conf  >/dev/null <<EOF
    [Socket]
    ListenStream=
    ListenStream=7500
    EOF
  3. Reload Systemd daemon configuration.

    If you edit Systemd configuration you must reload Systemd daemon configuration for the changes to take effect:

    sudo systemctl daemon-reload

You must configure the firewall to allow traffic to reach the configured TCP port. See Update the Firewall Policy to configure the firewall.