DEV Community

Cover image for Don't make this mistake  sudo chown -R 'userName' /*
Ismael Garcia
Ismael Garcia

Posted on • Edited on

1 2

Don't make this mistake sudo chown -R 'userName' /*

Recently I was trying to change the owner for the folder that a docker compose volume created and I accidentally ran the following command

 sudo chown -R 'userName' /*
Enter fullscreen mode Exit fullscreen mode

Then hell broke lose, so now probably you are in the same situation.

Reboot your computer and hold F11 (Please check which one is for your computer, F8 is the case on my computer) after the BIOS splash to bring up the GRUB boot menu. If you use one of the popular distros of linux (something like Ubuntu), there should be an option to start linux in recovery mode (the option might be found under 'Advanced Options' sub-menu if you use GRUB 2). Start linux in recovery mode.

Then select the option that will give you a root prompt. Since the shell is logged in as root, all commands will be run as root without needing the sudo command. You can use this to repair the permissions on /usr/bin/sudo:

chown root:root /usr/bin/sudo
chmod u+s /usr/bin/sudo
exit
Enter fullscreen mode Exit fullscreen mode

After this you can reboot to regular mode that should fix it

view raw socials.md hosted with ❤ by GitHub

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay