Running Faspex 5 as non-root on systems with Podman runtime
Run Faspex 5 as a non-root user for enhanced security and resource efficiency.
Attention: Steps one through seven must be performed as the root user.
- Install Faspex 5 following the instructions in the Installation and upgrades section.
- Create a non-root user to run Faspex 5, for example
newuser:useradd -m newuser - Change ownership to the newly created non-root
user:
chown -R newuser:newuser /opt/aspera/faspex - Disable Podman in the context of the
rootuser:systemctl disable --now podman podman.socket - Set a password for the non-root user for SSH access:
passwd newuser - Enable linger for the non-root user. This will make Faspex 5 startup after
rebooting:
loginctl enable-linger newuser - Give the non-root user
sudopermissions, add the following to thevisudofile:%newuser ALL= NOPASSWD: /bin/systemctl enable --now --user podman podman.socket %newuser ALL= NOPASSWD: /bin/systemctl disable podman.socket %newuser ALL= NOPASSWD: /bin/systemctl restart podman.socket %newuser ALL= NOPASSWD: /bin/systemctl enable faspexctl.service %newuser ALL= NOPASSWD: /bin/systemctl start faspexctl.service %newuser ALL= NOPASSWD: /bin/systemctl restart faspexctl.serviceAttention: Steps eight through 14 must be performed by the new non-root user. You must connect through an SSH session for security reasons, rather than just switching to a non-root user using thesucommand. - SSH as the new non-root user:
ssh newuser@FQDN/IP_ADDR - Enable Podman as the new non-root
user:
systemctl enable --now --user podman podman.socket - Add the
UIDof the non-root user to theDOCKER_HOSTunix socket.echo "export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock" >> ~/.bashrc - Reload the
bashrcfile:. ~/.bashrc - Edit the /opt/aspera/faspex/conf/docker/router.env file. The
httpandhttpsports must be higher than1024(low number ports are reserved forrootusers). For example, you could use8085and7443. Make sure the ports you choose are not already bound to some other service. - Run
faspexctl setup. When you receive theip promptenter the IP address or FQDN.$IP_ADDR or $FQDN:$CUSTOM_HTTPS_PORT - Confirm that services are run as the new non-root
user:
ps aux | grep aspera