Workaround broken sudo?

Posted by perreal on Server Fault See other posts from Server Fault or by perreal
Published on 2012-09-03T19:43:00Z Indexed on 2012/09/03 21:39 UTC
Read the original article Hit count: 160

Filed under:
|

I managed to break sudo by deleting the libc.so.6 sym-link in /lib. I copied the actual file and created a symbolic link with the same name under my home directory by using LD_PRELOAD=/lib/libc-2.11.3.so. At this point, all binaries linking libc are working through preload except sudo. For sudo, I need to write (and don't know why):

$ /lib/ld-linux-x86-64.so.2  --library-path . /usr/bin/sudo

but this gives me:

$ sudo: must be setuid root

Checking the permissions:

$ ls -l /usr/bin/sudo
$ -rwsr-xr-x 2 root root 166120

So the setuid bit is actually set.

Question:

I need to create a symbolic link named /lib/libc.so.6 through my active ssh connection without using sudo, or, make sudo work somehow. I don't have the root password and I can't connect through ssh anymore. Is there any other way I can get authorization?

© Server Fault or respective owner

Related posts about debian

Related posts about sudo