• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Ubuntu. Accidentally changed ownership of sudo

Nithin

Senior member
I changed owner to normal user. Now I can't do sudo anymore.
Say it needs to be setuid root.

I can't change it back now because sudo won't work.

root account is not enabled.

anything i can do? 🙁

N.
 
Either boot a live CD (perhaps even the install CD might work for this), mount the filesystem with sudo on it, and change the ownership that way, or if you can add init=/bin/bash at the bootloader's command line, then you will bypass everything that normally happens just after the kernel hands control over to userland and be dumped at a root shell; you can then remount the filesystems read/write and change ownership that way.
 
my first thought was the live cd option. the prob is that its a vmware install. it doesn't see the virtual hdisk when i boot through live cd.
i will try the init option.

[Edit] init= didn't work. i changed the boot line in grub.
but are you sure about it? if this actually worked it would be a huge
security blunder right?

N.
 
Originally posted by: Nithin
my first thought was the live cd option. the prob is that its a vmware install. it doesn't see the virtual hdisk when i boot through live cd.
i will try the init option.

[Edit] init= didn't work. i changed the boot line in grub.
but are you sure about it? if this actually worked it would be a huge
security blunder right?

N.

It should work (though maybe something VM-related is interfering). It's one reason why one should lock down the BIOS, the boot order, and the bootloader on machines where untrusted parties can gain physical access.
 
i see. then i dunno why it didn't work. i changed it like you said. it did the same thing it normall does.
went upto the graphical login.
 
Boot into single user mode and change it there. I don't know how grub does it, check the man page.

Don't mess with the permissions of things outside of ~/.
 
To get in a root terminal try Rescue or Recovery mode??

Well once you're in the root terminal you need to do

chown root /usr/bin/sudo
chmod 4111 /usr/bin/sudo

I think that should do it.

I did the same stupid thing to my friend's Ubuntu and he said he fixed it with those commands I later told him. Just wondering, did you change the permissions of the whole /usr/bin directory or just sudo? I actually changed my friend's whole /usr/bin directory by mistake and we just decided to reinstall it. Even though we fixed sudo, lots of other things got screwed up.
 
Originally posted by: Nithin
my first thought was the live cd option. the prob is that its a vmware install. it doesn't see the virtual hdisk when i boot through live cd.
i will try the init option.

[Edit] init= didn't work. i changed the boot line in grub.
but are you sure about it? if this actually worked it would be a huge
security blunder right?

N.

yeah single use mode should do it.
enter it
type
deluse <username>
adduser -u 1000 -g admin <usename>

might want to check the command using tabb cuiz i am not sure about spelling and stuff.
 
[Edit] init= didn't work. i changed the boot line in grub.
but are you sure about it? if this actually worked it would be a huge
security blunder right?

You are changing it on the kernel line in grub, right? Just add init=/bin/bash after the root=/dev/blah entry.

And no it's not a security blunder that you can do this, the real blunder would be you allowing untrusted people to physicall access your machine.
 
Back
Top