I accidentlly changed ownership of /usr/bin/sudo to my current user (i also did this for some other stuff in my /usr directory). I can't change any of them back because I need ownership of /usr/bin/sudo to be root to do so. I do not have root access because I'm on an Amazon EC2 instance running linux.

Here's what I did (foolishly I know):

sudo chown -R currentuser.currentuser /usr/

I've also hosed a ton of other stuff in the process, but I think it can all be solved if I can reset ownership of /usr/bin/sudo

Please help. I'm brand new to Linux admin and am doing everything from the command line.

EDIT: I used -R in my sudo chown command.

EDIT2: I have most of my data on a separate, mounted EBS, but I'm awful with server admin and it'll probably take me an entire day to setup a new instance.

  • You might need to get your instance reset... – antlersoft Jul 13 '11 at 21:01
  • Should be migrated to unix.SE – Michael Jul 13 '11 at 21:01
  • 1
    That command only changes ownership for /usr, not for /usr/bin/sudo... – bdonlan Jul 13 '11 at 21:01
  • 2
    @bdonlan He must've used -R :-/ – cnicutar Jul 13 '11 at 21:02
  • 1
    Please do not post the same question to multiple sites. sagi's reposted his answer on Server Fault, so I'm flagging to delete this copy of the question. – Gilles 'SO- stop being evil' Jul 15 '11 at 10:59

Are you running on an EBS volume? Can you afford to shutdown the instance for a few minutes?

If you do, then you can temporarily stop the current instance, start another instance, mount the EBS volume of the first instance and fix its permissions, then unmount it and re-start the first instance.


There was no solution that allowed me to fix this problem from within that system with that user. I could not get root access, and there was no trick to get around the problem.

I had to ditch the server and start anew.

Not the answer you're looking for? Browse other questions tagged or ask your own question.