sudo must be setuid root.

Guy's

I'm trying to add some lines in sudo by useing this command visudo

 
 
 
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
 
%sysadmin ALL=(root) /usr/sbin/shutdown,/usr/bin/topas,/usr/bin/svmon,/usr/bin/lsof,/opt/sarcheck/bin/sarcheck,/usr/bin/stopsrc,/usr
/sbin/fuser,/usr/sbin/umount,/usr/sbin/mount,/usr/bin/chown,/usr/bin/chmod,/usr/bin/find,/usr/bin/mksysb,/usr/bin/truss,/usr/sbin/tc
pdump,/usr/bin/vmstat,/usr/sbin/varyoffvg,/usr/sbin/exportvg,/usr/sbin/varyonvg,/usr/sbin/importvg
 
 
:wq!
 
when I try to save I'm getting the belwo
 
"/etc/sudoers.tmp" 31 lines, 945 characters 
>>> sudoers file: syntax error, line 29 <<<
>>> sudoers file: syntax error, line 30 <<<
What now? \
Options are:
(e)dit sudoers file again
e(x)it without saving changes to sudoers file
(Q)uit and save changes to sudoers file (DANGER!)
What now? 
 

when I try to run sudo -l

I'm getting the below ?

Sorry, sudo must be setuid root.

Please help me in this regard and advices ....

It means what it says. The permissions of the sudo executable are incorrect for some reason, preventing it from running as root, preventing it from changing users. On my system(not AIX) sudo's permissions are:

$ ls -l /usr/bin/sudo
---s--x--x 1 root root 139528 2008-07-06 17:35 /usr/bin/sudo
$

Your sudoers file has syntax error.
You must resolve them before you proceed with sudo -l

This is my permissions still I'm getting the same ?!! can you please advices in this regard ....

P690_server/>ls -l /usr/bin/sudo
lrwxrwxrwx    1 root     system           27 Aug 18 2009  /usr/bin/sudo -> ../../opt/freeware/bin/sudo

P690_server>sudo -l
Sorry, sudo must be setuid root.

Quick question: did you really, really read the thread so far? And why do you think the permissions on a link even remotely influence the file linked to?

Check the permissions for /opt/freeware/bin/sudo. If that's a link too, follow it again. Repeat until you encounter a regular file. That needs to have 3 certain attributes:

  • it has to be owned by the user root
  • it has to have the sticky bit set (chmod u+s as root)
  • it has to be executable for those allowed to use it

Thank you very match .......

problem was in the owner of this file /opt/freeware/bin/sudo

---s--x--x 1 bin bin 114730 Jul 07 2005 /opt/freeware/bin/sudo

chown root:system /opt/freeware/bin/sudo

ls -la /opt/freeware/bin/sudo

---s--x--x 1 root system 114730 Jul 07 2005 /opt/freeware/bin/sudo

sudo is working fain now ................ solved