Thursday, January 23, 2014

Fix: sudo: setresuid(ROOT_UID, ROOT_UID, ROOT_UID): Operation not permitted

This is a known bug for Ubuntu 12.04 with LDAP

It is caused by libgcrypt in GnuTLS that used by LDAP for SSL connections.

Solution:
Use libnettle instead of libgcrypt, and recompile gnutls26

Since you don't have sudo, you can use Ubuntu disk boot into rescue mode.
1) create the root user
or
2) gain sudo by disabling the ldap  $ mv /etc/ldap.conf /etc/ldap.conf.backup; $ reboot

After you have the root privilege, boot your machine into normal disk.  The following commands disabled ldap when fixing this bug.

Step 1. Install necessary packages

sudo apt-get install libgmp-dev devscripts 
sudo apt-get build-dep libgnutls26

Step 2. Download and install nettle

$ wget http://www.lysator.liu.se/~nisse/archive/nettle-2.1.tar.gz 
$ tar zxvf nettle-2.1.tar.gz 
$ cd nettle-2.1 
$./configure --with-gmp 
$ make 
$ sudo make install
$ sudo reboot ( I have a compiling issue with gnutls26 if don't reboot here)

Step 3. Compile and build gnutls26

$ sudo apt-get source gnutls26
$ cd gnutls26-2.12.14
$ sudo vim debian/rules
remove --with-libgcrypt

$ sudo debuild -i -uc -us -b 
$ cd .. 
$ dpkg -i libgnutls26_2.12.14*.deb

Source: 
https://jeroenvda.eu/2012/05/03/cannot-setuid-after-ubuntu-12-04lts-upgrade-when-using-ldap-accounts/
http://askubuntu.com/questions/106642/how-to-fix-sudo-setreuidroot-uid-user-uid-operation-not-permitted-error

No comments: