By prasannanwr
We accidently chmod-ed 777 in whole directory structure. So, The situation is that we cannot access root or ‘sudo’ mode for our normal user. We also may have changed the permission of critical files like /etc/passwd /etc/shadow and /etc/sudoers , which seem to have causing the problem.
The idea solution, if it was our server would be to change the permission from another machine and then chroot back and do necessary changes. Since this is hosted on DigitalOcean cloud, this seems impossible.
How do I recover root and sudo access?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Unfortunately there is no quick way to restore filesystem permissions on Ubuntu if this occurs. Instead I would recommend opening a ticket with our support team. They can boot your droplet using our recovery ISO (a Debian based LiveCD image) that will allow you to get an SFTP service up and running in order to download a copy of your files. I would then recommend starting over with a clean droplet and restoring your services.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.