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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay