Posted over 8 years ago. Visible to the public.

mtr says "mtr: unable to get raw sockets"

This is because mtr needs to open raw sockets, which it can only do as root:

$ mtr mtr: unable to get raw sockets. $ sudo mtr Keys: Help Display mode Restart statistics Order of fields quit Packets Pings Host Loss% Snt Last Avg Best Wrst StDev 1. 0.0% 69 24.9 32.0 24.8 88.8 12.5 2. ??? 3. 0.0% 69 24.9 26.5 24.9 35.9 1.6

This can be avoided by changing the ownership of mtr to root and activating the suid bit:

$ sudo chown root:wheel /usr/local/Cellar/mtr/0.85/sbin/mtr $ sudo chmod u+s /usr/local/Cellar/mtr/0.85/sbin/mtr

You are probably reading this because you overlooked the "Caveats" in the install messages:

mtr requires superuser privileges. You can either run the program via `sudo`, or change its ownership to root and set the setuid bit: sudo chown root:wheel /usr/local/Cellar/mtr/0.85/sbin/mtr sudo chmod u+s /usr/local/Cellar/mtr/0.85/sbin/mtr In any case, you should be certain that you trust the software you are executing with elevated privileges.

Owner of this card:

Christoph Beck
Last edit:
over 8 years ago
Posted by Christoph Beck to BitCrowd
This website uses short-lived cookies to improve usability.
Accept or learn more