By ivcfadmin
withou it I cant change owneship.
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!
This is pretty hard to solve. Maybe there is very little chance but usually problems like these finishes with Rebuilding droplets or restoring backups.
I will try to give you few ideas how to fix but I can’t guarantee it will work, or it will make it work worse. Use it on your own risk.
First problem is that you don’t know anymore who is default owner of files. You can try to give owner of everything to root. Maybe it will work better, but root is not default owner of all files/folders.
You can spin one $5 droplet and look at default owners.
If you are using Ubuntu 14.04.x you should have option of Recovery kernel.
On Ubuntu 16.04, you are out-of-luck with Recovery kernel, as it is not possible to change kernel anymore. Maybe you can contact support and ask them to enable it for you, but I’m not sure is it possible anymore.
If you have this possibility or DO let you somehow use it, you will need Interactive Shell, in which you can try giving everything to root or looking at default owners and giving it to files respectively.
You can give everything to root with (not recommended, really):
- chown -R root:root /.
want to give to their default owner syntax of chown command is:
chown user:group file
or if you want to apply to all files in directory
chown -R user:group directory
Note the -R switch, it means recursively, it will apply permissions/owner to all directories/files in selected directory.
If you don’t have recovery kernel, I have found somewhere this command:
- pkexec chown root:root /usr/bin/sudo
It should return your sudo so you can use chown from your system.
You can try it as root user if it is not working from non-root user. If you disabled root logins via SSH, you can use Console. Go to Control Panel, select your droplet and click console. If you don’t have password, you can use option Reset root password from Control Panel.
After that try sudo to see if it works.
Anyways with this wall of text, I really, really recommend you to rebuild droplet or restore backup. You will never know right permissions, and server can break anytime. Good luck
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.