stellarbit/aioping

Root-less ping

Yamakaky opened this issue · 3 comments

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.

Here ping3 fallbacks to SOCK_DGRAM on permission errors and it seems to be working fine.

Edit: see ping3 commit that adds root-less ping support

Nice!