I'm trying to use capsh to grant myself a shell with no capabilities at all with a certain user. This is so I can test security stuff related to being non-root but with only certain capabilities.
Basically I'd like to get a shell running with something similar to this. This would emulate the state under which the test program runs.
capsh --print
Current: =
Bounding set =
Securebits: 00/0x0/1'b0
secure-noroot: no (unlocked)
secure-no-suid-fixup: no (unlocked)
secure-keep-caps: no (unlocked)
uid=10101(u0_a101)
gid=10101(u0_a101)
groups=9997(everybody),50101(all_a101)
Then I'd like to be able to run capsh again to grant the user some capabilities and/or change uid/gid if it's at all possible.
I haven't found any good tutorials on capsh if anyone has a good reference.