0

apparently I messed up too much with my permissions and now I'm getting this while trying to use 'screen' again:

/usr/bin/sudo must be owned by uid 0 and have the setuid bit set

If I try: chown root:root /usr/bin as suggested in some answers, I get: changing ownership of '/usr/bin': Operation not permitted.

I've found other similar questions/answers, such as: get back sudo on ubuntu but I'm using Putty with Amazon EC2 web services, and they suggest in to reboot into user mode and then root. I don't know how to do that in Putty.

From what I read is kind of serious, so is the only option to detach my instance from the storage volume and start over again?

  • 1
    You could also switch to root using su - (giving the root user's password when asked for a password), then fix the issue and exit. – Kusalananda May 8 at 12:34
  • Thank you for your reply, but with EC2 I don't really use a password, I use a keychain (a file stored in my computer) to access every time, from there the confusion on how to fix this problem. – pollux7 May 8 at 12:50
  • I nope no-one has really suggested chown root:root /usr/bin, as that's potentially a really bad idea. (Perhaps you've misread or mistyped the suggestion?) If you have a root password you should use the su approach suggested in your apparent duplicate. (You may not use it much, but you might have one given to you as part of the initial install.) – roaima May 8 at 14:22
  • I'll check that, thank you! – pollux7 May 8 at 21:42
  • @roaima EC2 instances do not have root passwords, unless the customer changes that. The default user is a passwordless sudoer. – Michael - sqlbot May 9 at 0:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.