Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jul 14 '11 at 1:05

This question came from our site for professional and enthusiast programmers.

closed as off topic by Gilles, Michael Mrozek Jul 15 '11 at 13:46

Questions on Unix & Linux Stack Exchange are expected to relate to Unix or Linux within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
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 Jul 15 '11 at 10:59
show 6 more comments

2 Answers 2

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.

share|improve this answer
add comment
up vote 0 down vote accepted

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.

share|improve this answer
add comment

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