SG-5100: Running easyrule with dedicated user
-
I need to block / unblock certain client devices from accessing internet on demand (kids).
easyrule gives me what I want. for example
easyrule block lan 192.168.1.21
Since I want to call this script from a client device, I created a new user (easyRuler). In sudo package, easyRuler is allowed to only call /usr/local/bin/easyrule.
When easyRuler calls easyrule, I get the successful execution message
Host added successfully
Except that it actually fails. In the system.log, I can see this message
easyrule: WARNING: Config contents could not be saved. Could not open file! easyrule: New alert found: Unable to open /cf/conf/config.xml for writing in write_config()
I suspect it has to do with easyRuler's permissions. Maybe it needs to be able to run another process as root, besides easyrule. I just don't know which one. Appreciate any thoughts.
-
Turns out I need to "sudo" with my dedicated user for the command to work. Like this
sudo easyrule block lan 192.168.1.21