-1

When i type "sudo -i" on an EC2 instance, i get following error:

sudo: must be setuid root

Which means that someone has tampered with the sudo permissions. Now the only way to login to server and do administration was through "sudo -i". Is there any way i can get root access to server? or fix the sudo binary file setuid permission?

2
  • If this was the only way why you asking if there is another way? Jun 22, 2012 at 17:10
  • I am not GOD of information on this world, so if i said this was the only way, that doesnt means that i know everything. and its Obvious that when i say this was the only way, then intention to ask question was that may be someone might know some other way to login.
    – Farhan
    Jun 22, 2012 at 17:57

3 Answers 3

2

Actually i was able to login to server, i mounted thee partition of server into another server, set the suid and proper permissions, allowed root login and it worked.

1

This is a bad situation. If nobody else has root access and you can't use su there are very bad chances. I'd try to backup everything I can and start over.

-1

Yes, try "su -", you need suid flag on that file.

[root@m-01 ~]# ls -l /usr/bin/sudo
---s--x--x. 2 root root 197536 Mar 23 19:55 /usr/bin/sudo
[root@m-01 ~]# ls -l /bin/su
-rwsr-xr-x. 1 root root 30092 Jan  5 21:37 /bin/su

You need also suid flag not disabled on the / filesystem.

[root@m-01 ~]# mount
/dev/xvda1 on / type ext4 (rw,noatime,grpquota,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
2
  • i have already mentioned in my post that the suid is not set on it. its been removed.
    – Farhan
    Jun 22, 2012 at 17:04
  • 1
    But you have two binaries, one "su" and another "sudo", so please check both - you have mentioned only "sudo", while "su" might be still OK. Jun 22, 2012 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .