Root-less ping
Yamakaky opened this issue · 3 comments
Yamakaky commented
ping
is able to run without root on modern linux. See https://unix.stackexchange.com/questions/617927/why-ping-works-without-capability-and-setuid/617936#617936. Maybe it can be be adapted here? I tried to modify the socket()
call but I get a timeout every time, maybe I missed something.
te0d commented
Changing the socket type from SOCK_RAW
to SOCK_DGRAM
looks like it may allow it to work as a non-root user? It has worked for my purposes, but I have not tested it extensively.
mattmart3 commented
Here ping3 fallbacks to SOCK_DGRAM on permission errors and it seems to be working fine.
Yamakaky commented
Nice!