Skip to content

Instantly share code, notes, and snippets.

@sandys
Created May 3, 2012 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandys/2584113 to your computer and use it in GitHub Desktop.
Save sandys/2584113 to your computer and use it in GitHub Desktop.
Securing server processes by creating a non-privileged user to run commands
#add a system user
sudo adduser --system --home=/opt/openerp --group openerp
#copying config files to correct locations
#The below commands make the file owned and writeable only by the openerp user and group and only readable by openerp #and root.
sudo cp /opt/openerp/server/install/openerp-server.conf /etc/
sudo chown openerp: /etc/openerp-server.conf
sudo chmod 640 /etc/openerp-server.conf
#running the command
sudo su - openerp -s /bin/bash # to open a shell
#or
sudo -u openerp /opt/openerp/server/openerp-server --config=/opt/openerp/server/install/openerp-server.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment