Proper sudo configuration #2

Closed
niclashoyer opened this Issue Jun 29, 2014 · 5 comments

Projects

None yet

2 participants

@niclashoyer

The readme states:

Other requirement is about permission levels. To properly execute the provided methods the application that uses the module must have the proper sudo privileges.

What does that mean? I thought I had to configure sudo in such a way that the user which runs the netfilter package also should have the privileges to run sudo iptables, sudo ip6tables and sudo ipset. But looking at the source code the commands are called without sudo prefix.

I would add a user e.g. netfilter and add the following entries to /etc/sudoers:

netfilter ALL= NOPASSWD: /sbin/iptables, /sbin/ip6tables, /sbin/ipset

and then run my node program using this user:

su netfilter -c "node example.js"
@diosney
Owner
diosney commented Jun 30, 2014

I will add in the next days an option to enable the commands execution via sudo, something like:

 cmd.show({ sudo: true }, function(error, cb){});

That will be ok for you?

@niclashoyer

That would be great!
btw. can you also add this option to the iproute package?

@diosney diosney added a commit that closed this issue Jul 3, 2014
@diosney Fixes #2. 1fd1dc9
@diosney diosney closed this in 1fd1dc9 Jul 3, 2014
@diosney
Owner
diosney commented Jul 3, 2014

Sure! I will work now on its addition to the iproute package.

If you find anything else, don't doubt to comment about it.

@diosney
Owner
diosney commented Jul 3, 2014

I already added this sudo support to iproute too, test it and let me know your toughts.

:)

@niclashoyer

Cool! I'll test it as soon as possible. I've got one more thing about error handling that I noticed while testing. I'll open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment