Score:0

Fixing permissions on home directory

br flag

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
FedKad avatar
cn flag
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_.
Score:0
jp flag

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".

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.