Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 lamppadmin or serviceadmin group

share|improve this question
    
Since this depends on the init system used, it will never be platform agnostic without a bunch of if [[ $os == blah ]] like statements. –  jordanm Nov 1 '12 at 23:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.