I am trying to set up a web server at home using Ubuntu, but prefer my bash scripts to be platform agnostic hence why I am asking here. I also dislike apt-get everything. I am trying to create a single bash script to quickly rebuild my server or possibly use with VM's
It is my understanding that any services with open ports can pose security risks if run as 'root' to avoid this I have created a
serviceadmin group and for each service I create a user similar to:
useradd lamppadmin -g servicepadmin -s /sbin/nologin useradd tomcatadmin -g servicepadmin -s /sbin/nologin
I then install the needed services and restrict their permissions and files accordingly. Given that I am most likely to add more services to this group, I would like to know how one launches multiple service to "run as" group or each individual service as the appropriate user.
I always symbolically link launch commands to
/usr/binso that I am able to run them from anywhere. So I am just looking for an example to target
lampp start as an example where it needs to interact with files that belong to user