Run a command with ambient capabilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run from terminal like enter-caps ./wireshark | |
export PS1="#$PS1" | |
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1 | |
caps=cap_net_admin,cap_net_raw | |
sudo -E capsh --keep=1 --caps="cap_setuid,cap_setgid,cap_setpcap+ep $caps+eip" --user=[my_hardcoded_username] --addamb="$caps" -- -c "$@" | |
echo "...Exiting enter-caps" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment