Sample Header Ad - 728x90

'setcap' overwrites last capability. How do I set multiple capabilities?

22 votes
2 answers
10252 views
I want to give node.js the ability to listen on port 80, and shutdown the computer. Initially I tried these two commands in sequence: setcap cap_net_bind_service=+ep /usr/bin/nodejs setcap cap_sys_boot=+ep /usr/bin/nodejs Then my app was failing to bind to port 80. I checked with getcap: # getcap /usr/bin/nodejs /usr/bin/nodejs = cap_sys_boot+ep If I run setcap again for cap_net_bind_service: # getcap /usr/bin/nodejs /usr/bin/nodejs = cap_net_bind_service+ep I don't see anything in the man page http://linux.die.net/man/8/setcap about setting multiple capabilities, and try some things in desperation: # setcap cap_net_bind_service=+ep /usr/bin/nodejs cap_sys_boot=+ep /usr/bin/nodejs # getcap /usr/bin/nodejs /usr/bin/nodejs = cap_sys_boot+ep # setcap cap_net_bind_service=+ep cap_sys_boot=+ep /usr/bin/nodejs Failed to set capabilities on file `cap_sys_boot=+ep' (No such file or directory) How do I set multiple capabilities?­­­­­­­
Asked by Antonius Bloch (673 rep)
Feb 25, 2015, 11:33 PM
Last activity: Sep 29, 2022, 08:58 AM