this post was submitted on 18 Mar 2024
46 points (94.2% liked)

Asklemmy

43381 readers
1398 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_[email protected]~

founded 5 years ago
MODERATORS
 

sudo's Hall of pain

you are viewing a single comment's thread
view the rest of the comments
[โ€“] adsche 2 points 6 months ago* (last edited 6 months ago) (1 children)

The above command just changed all files ownership to root (privileged user)

Hey uhm, are you sure? That seems wrong.

For me, the command removes read, write, and execute permissions of the user, and read and execute permissions for everyone else. Which would be expected.

chown would be the command to change ownership...

To run any app now, you need to open a new terminal and type sudo -E app-name &,

You could also try and fix the permissions by running sudo chmod -R u+rwX g+rX /home/user. That will fix all access permissions first of all. Then, you might have to fix execute permissions (but do this only on files that are meant to be executed!) using chmod +x path/to/file.

Solutions Be extra extra careful while running sudo commands

Yes. But you (as the owner) would not even have needed sudo for the chmod command to succeed. I think you might have just slightly misunderstood chmod's syntax. Your command as given means "recursively, remove the permissions 755 (you have a - in front of them!). It sounds like you probably wanted chmod -R 755 ... (without -, giving read/write/execute to the owner and read/execute to everyone else). But the descriptive notation above is probably easier to remember. Read the manpage maybe...

[โ€“] 0_0j 1 points 6 months ago

Very informative, thank you.