Creating the Resonate User trif-user

Creating the Resonate User trif-user

Create the user
trif-user
. This user is required to run
Resonate
. The user will own the installation directory and have access to the Kubernetes cluster. If setting up a multi-node cluster, perform these steps only on the primary node.
  1. Create the required directory:
    TRIFECTA_INSTALL_DIRECTORY="/opt/zebra/trifecta" TRIFECTA_USER="trif-user" sudo mkdir -p "$TRIFECTA_INSTALL_DIRECTORY"
  2. Create the user trif-user.
    For Ubuntu:
    sudo adduser --no-create-home $TRIFECTA_USER --home $TRIFECTA_INSTALL_DIRECTORY --shell "$(command -v bash)" --disabled-password --gecos ""
    For Red Hat:
    sudo adduser --no-create-home $TRIFECTA_USER --home-dir $TRIFECTA_INSTALL_DIRECTORY --shell "$(command -v bash)"
  3. Configure snap home directories (for newer snap versions):
    SNAP_VERSION=$(snap version | grep snapd | awk '{print $2}') if [ "$(printf '%s\n' "$SNAP_VERSION" "2.59" | sort -V | head -n1)" = "2.59" ]; then sudo snap set system homedirs="$(dirname $TRIFECTA_INSTALL_DIRECTORY)" fi
    To use snap with other home directories for non-
    Resonate
    installation purposes (for example, installing security agents), set the
    homedirs
    parameter to a comma-delimited list of paths (for example,
    homedirs="$(dirname $TRIFECTA_INSTALL_DIRECTORY),/home,/other/home"
    ).
  4. Set up directories and permissions:
    sudo mkdir -p $TRIFECTA_INSTALL_DIRECTORY sudo mkdir -p $TRIFECTA_INSTALL_DIRECTORY/.kube sudo chown -R $TRIFECTA_USER $TRIFECTA_INSTALL_DIRECTORY # Add user to microk8s group sudo getent group microk8s >/dev/null || sudo groupadd microk8s sudo usermod -aG microk8s $TRIFECTA_USER
  5. Extract the
    Resonate
    application from the
    trifecta.tar
    file:
    if [ -f trifecta.tar ]; then sudo cp trifecta.tar $TRIFECTA_INSTALL_DIRECTORY/ sudo chown $TRIFECTA_USER $TRIFECTA_INSTALL_DIRECTORY/trifecta.tar sudo -u $TRIFECTA_USER tar xf $TRIFECTA_INSTALL_DIRECTORY/trifecta.tar --no-same-owner --no-same-permissions -C $TRIFECTA_INSTALL_DIRECTORY sudo rm $TRIFECTA_INSTALL_DIRECTORY/trifecta.tar fi