0

I am using AWS to run Ubuntu server 14.04 and by mistake I issued this command

sudo chmod -R 777 /usr/

Since issuing this command, I can't switch from ubuntu to root. When I issue this command

sudo su

It shows me error

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

I don't have a backup of my server.

Zanna
  • 70,465
  • 2
    No backup? And you "accidentlally" typed sudo ANYTHING*? You broke your system. Start over. – waltinator Oct 28 '17 at 04:57
  • I didn't get you, now what should I do? – Vishal Rabadiya Oct 28 '17 at 05:17
  • You can attempt to restore permission see https://askubuntu.com/questions/43621/what-if-i-accidentally-run-command-chmod-r-on-system-directories-etc . There are several scripts there, but I posted a method using apt-get from recovery mode as well , take your pick. – Panther Oct 28 '17 at 12:49
  • 2
    "I don't have a backup of my server." Sorry? @Panther AWS. He wont be able to use a live session. And all other solutions depend on "sudo" working. waltinator is probably correct: delete the instance and recreating it will probably be the only way. – Rinzwind Oct 28 '17 at 18:02
  • I don't see how you can resolve this without physical access to the server which you aren't going to get with AWS. Backups aren't optional, they are mandatory. – Elder Geek Oct 28 '17 at 21:02

0 Answers0