0

This question already has an answer here:

While using sudo su I am getting this error:

sgr@sgr-VirtualBox:~$ sudo su
sudo: must be setuid root

I cannot log in to root? Why/How to fix it?

marked as duplicate by muru, Community Aug 14 '15 at 9:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • srg@srg-VirtualBox:/$ chown root:root /usr/bin/sudo chown: changing ownership of `/usr/bin/sudo': Operation not permitted ....i followed this link( askubuntu.com/questions/431959/… ) “Sudo: Must Be Setuid Root” error after login to diskless client.thank you – susan Aug 14 '15 at 9:47
  • Clearly you haven't followed the steps. – muru Aug 14 '15 at 9:47
2

The root cause is someone messed with /usr/bin/sudo permissions. They should be something like :

$ ls -l /usr/bin/sudo
-rwsr-xr-x 1 root root 155008 Mar 12 17:27 /usr/bin/sudo

but for some reason, yours are likely (note the 's' vs 'x') :

-rwxr-xr-x 1 root root 155008 Mar 12 17:27 /usr/bin/sudo

How to fix it:

Boot a CD, DVD or USB key having a live distribution on it, mount your / file system and fix sudo permissions, and any other that might have been tampered. For example, here is a list of some files having the s bit set on my machine :

$ find /bin /sbin /usr/bin /usr/sbin -perm /u=s
/bin/mount
/bin/ping6
/bin/fusermount
/bin/ping
/bin/umount
/bin/su
/sbin/mount.cifs
/sbin/mount.ecryptfs_private
/usr/bin/sudo
/usr/bin/chsh
/usr/bin/gpasswd
/usr/bin/mtr
/usr/bin/lppasswd
/usr/bin/traceroute6.iputils
/usr/bin/X
/usr/bin/passwd
/usr/bin/newgrp
/usr/bin/pkexec
/usr/bin/chfn
/usr/sbin/uuidd
/usr/sbin/pppd
/usr/sbin/pppoe
  • I found the problem. I have copied the OS files from client pc to server pc. I have to change permission to one file so, by mistake i I changed the permissions(chmod 777 *)after exiting from root.then in got this problem.how to fix this? – susan Aug 14 '15 at 9:31
  • Answer updated to add the "how to fix" part. – jlliagre Aug 14 '15 at 9:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.