0

So I was following a guide (incorrectly) and mindlessly ended up giving owner permissions to my home directory (/home/username) to a different group (or user, not sure which is which). I figured out how to get myself owner back, but now it seems like I have a bunch of messed up permissions with directories inside my home directory. For example Flatpak apps which are installed in ~/. local/share/flatpak no longer open. How can I revert back to how everything was before?

Here are the commands I used:

sudo chown -R plex: /home/username

Then using this as a reference I did the following:

sudo chown -R username:username  /home/username
find /home/username -type f -print0 | xargs -0 chmod 664
find /home/username -type d -print0 | xargs -0 chmod 775
1
  • You can just run sudo chown -R userid:groupid /home/username. In this command, userid should be presumably the same with username. Please, first check the userid and the groupid using the command id (run the id command with your current user; not using sudo). userid should be the value given in uid= userid and groupid should be the value given in gid= groupid.
    – FedKad
    Commented Nov 13, 2021 at 10:32

1 Answer 1

0

as far as I know, there is not a way to magically put permissions back to the way they were before a change made by command line (or GUI actually). And as far as I know there would not be anything other than your username applied to permissions inside your /home/username folder.

However, what I expect has happened, is in your first command (the one where you applied the Plex owner to the files) you've applied to all files including hidden files that start with a '.'.

In the second command I suspect it doesn't put your username back on the hidden files, i.e. only the files that start without a dot.

If you want to check it first, just do:

# cd /home/username
# ls -lah

Then look for the user / group ownership on the hidden files. If any of them are still showing as Plex, then you know this is the issue.

To fix this there would be a number of ways, but I'd just do something like

# cd /home/username
# chown . username.group -Rfv.

Starting with a . like that will apply the ownership to the hidden files as well because it is just saying, "start the apply here, where I already am in /home/username".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .