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

Linux Capabilities #22

Closed
sepbot opened this issue Jul 9, 2014 · 2 comments
Closed

Linux Capabilities #22

sepbot opened this issue Jul 9, 2014 · 2 comments
Labels

Comments

@sepbot
Copy link

sepbot commented Jul 9, 2014

Is it possible to alter Linux capabilities of the Java binary in order to use pcap4j without administrative privileges?

I have tried giving JAVA_HOME/bin/java capabilities such as CAP_NET_ADMIN and CAP_NET_BIND_SERVICE amongst many other capabilities, however making a very simple call such as Pcaps.getDevByName("lo") still returns null unless I specifically call my application using the sudo command.

Is it in anyway possible to use this library without administrative privileges?

@kaitoy
Copy link
Owner

kaitoy commented Jul 11, 2014

I could run a Pcap4J sample with a non-root user by adding cap_net_raw to java command. cap_net_admin may be also needed for some features.

@sepbot
Copy link
Author

sepbot commented Jul 12, 2014

I think there was a problem with the kernel I was using. I upgraded to 3.2.0-65-generic and it seems to be working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants