On AWS EC2, Unable to run sudo command after modifying permissions to /usr folder
- by Kayote
All,
We have searched quite a bit and a few of 'Eliah Kagan's' posts are great about getting access back to sudo. However, our server is on AWS EC2 & I am a complete newbie to this.
We are trying to setup Cronjobs for backing up our server data.
What we did:
Using Putty, we created a script file: usr/share/site-db-backup/backupToS3.php, however, Ubuntu was not saving the changes we made as it reported we did not have permission as user 'Ubuntu'. Error details are:
"Upload of file backupToS3.php was successful but error occurred while setting the permission &/ or timestamp. If the problem persists, turn on 'ignore permission errors' option.
Permission denied.
Error code: 3
Request code 9"
So, we ran the command "sudo chmod -R a+rwx /usr" for granting permission to the folder 'usr'.
However, now whatever sudo command is run, we get the error:
"/usr/lib/sudo/sudoers.so must be only be writable by owner.
fatal error, unable to load plugins."
We are complete newbies to Ubuntu & EC2 so do need step by step guidance of how to get sudo back & successfully write to the Crontab script sitting in 'usr/' folder.