Effective uid is not 0, is sudo installed setuid root? I copied a file named class-dump to my /usr/bin folder, then neither Terminal.app nor iTerm2 work properly on my MacBook. There is something wrong with the sudo command.

Here is what I did based on some online searching:

sudo 
sudo: effective uid is not 0, is sudo installed setuid root?
type sudo
sudo is hashed (/usr/bin/sudo)
ls -@@eil /usr/bin/sudo
1485457 -rwxrwxrwx  1 root  wheel  168448  7  9  2016 /usr/bin/sudo
md5 /usr/bin/sudo
MD5 (/usr/bin/sudo) = 7d986f7707c0f11264989cd7105ea80d


Does anyone know how I can make sudo work again?
Boot to Recovery Mode(cmdR)/Internet Recovery Mode (altcmdR).
Get the name of your main system volume: df
Usually it's the "Mounted on"- name of the device disk0s2 (e.g Macintosh HD) - simply check the sizes.
Enter chmod 4511 /Volumes/Name_Of_Sys_Vol/usr/bin/sudo

Replace Name_Of_Sys_Vol by the volume name found in the previous command. If the name contains spaces, escape them with \. Example:

chmod 4511 /Volumes/Macintosh\ HD/usr/bin/sudo

Check with ls -l /Volumes/Name_Of_Sys_Vol/usr/bin/sudo which should yield:

-r-s--x--x  1 root  wheel  168448  7  9  2016 /Volumes/Name_Of_Sys_Vol/usr/bin/sudo





In Sierra with SIP enabled you wouldn't have been able to modify the permissions of sudo to 777. Therefore I assume Sierra isn't installed or SIP is disabled.

If Sierra is installed and SIP is enabled you have to disable it before applying changes to sudo..