Skip to content

Commit

Permalink
Fix setcap example
Browse files Browse the repository at this point in the history
* Use POSIX sh command substitution syntax
* Use `command -v` shell built-in instead of `which`
  • Loading branch information
teohhanhui authored and cyqsimon committed Aug 25, 2023
1 parent 3d2599a commit e4420fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ OPTIONS:
On Linux, you can give the `bandwhich` binary a permanent capability to use the required privileges, so that you don't need to use `sudo bandwhich` anymore:

```bash
sudo setcap cap_sys_ptrace,cap_dac_read_search,cap_net_raw,cap_net_admin+ep `which bandwhich`
sudo setcap cap_sys_ptrace,cap_dac_read_search,cap_net_raw,cap_net_admin+ep $(command -v bandwhich)
```
`cap_sys_ptrace,cap_dac_read_search` gives `bandwhich` capability to list `/proc/<pid>/fd/` and resolve symlinks in that directory. It needs this capability to determine which opened port belongs to which process. `cap_net_raw,cap_net_admin` gives `bandwhich` capability to capture packets on your system.

Expand Down

0 comments on commit e4420fb

Please sign in to comment.