Monday, February 22, 2016

Solaris 10 - sudo su - sudo: must be setuid root


unable to sudo to root. logged in as normal user and become root using su -.
checked the sudo permission and worked after changing the permission of sudo file with setuid.

$ sudo su -
sudo: must be setuid root
# which sudo
/usr/sbin/sudo
# ls -l /usr/sbin/sudo
lrwxrwxrwx   1 root     root          19 Feb 22 09:39 /usr/sbin/sudo -> /usr/local/bin/sudo

# ls -l /usr/local/bin/sudo
-rwxrwxr-x   1 root     root       94982 Dec  6  2011 /usr/local/bin/sudo

# chmod 2111 /usr/local/bin/sudo

#  ls -l /usr/local/bin/sudo
---x--s--x   1 root     root       94982 Dec  6  2011 /usr/local/bin/sudo
$ sudo su -
sudo: must be setuid root

# chmod u+s,g-s /usr/local/bin/sudo

$ ls -l /usr/local/bin/sudo /usr/sbin/sudo
---s--x--x   1 root     root       94982 Dec  6  2011 /usr/local/bin/sudo

$ sudo su -
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
You have new mail.
#

 

No comments:

Post a Comment