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

Pcap need elevated privileges #2

Open
fabiodellafiorentina opened this issue Jan 6, 2017 · 2 comments
Open

Pcap need elevated privileges #2

fabiodellafiorentina opened this issue Jan 6, 2017 · 2 comments

Comments

@fabiodellafiorentina
Copy link

I receive the error below from node red:

Error: socket: Operation not permitted
at new PcapSession (/home/pi/.node-red/node_modules/pcap/pcap.js:49:39)
at Object.exports.createSession (/home/pi/.node-red/node_modules/pcap/pcap.js:123:12)
at create_session (/home/pi/.node-red/node_modules/node-red-contrib-amazondash/node_modules/node-dash-button/index. js:12:28)
at register (/home/pi/.node-red/node_modules/node-red-contrib-amazondash/node_modules/node-dash-button/index.js:29: 24)
at new node (/home/pi/.node-red/node_modules/node-red-contrib-amazondash/button-pressed.js:14:20)
at createNode (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:302:18)
at Flow.start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:87:35)
at start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:277:29)
at tryCatchReject (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:845:30)
at runContinuation1 (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:804:4)
at Fulfilled.when (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:592:4)
at Pending.run (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:483:13)
at Scheduler._drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:62:19)
at Scheduler.drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:27:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Failed to create pcap session: couldn't find devices to listen on.
Try running with elevated privileges via 'sudo'
6 Jan 23:03:35 - [error] [ButtonPressed:79260a05.2b2d34] Error: Error: No devices to listen

I understand I need to run Pcap with higher privileges. Do you have any ideas?

@pucbaldwin
Copy link

I have the same issue. Tried doing "sudo node-red-start" but same problem.

@mesche
Copy link

mesche commented Jul 25, 2017

@pucbaldwin
have you tried to set the filesystem capabilities for 'node' ?

sudo setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f $(which node))

you can find more infos here (german).

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

3 participants