Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper sudo configuration #2

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

Proper sudo configuration #2

niclashoyer opened this issue Jun 29, 2014 · 5 comments

Comments

@niclashoyer
Copy link

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
Copy link
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
Copy link
Author

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

@diosney diosney closed this as completed in 1fd1dc9 Jul 3, 2014
@diosney
Copy link
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
Copy link
Owner

diosney commented Jul 3, 2014

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

:)

@niclashoyer
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants