13

Who is supposed to be the owner of the .config directory under user's home folder?

On my machine it appears to be owned by the system user and it is only readable by that user.

Several programs, like Homebrew and git (which should be allowed to be used without root permissions) complain by producing warnings as shown below:

warning: unable to access '/Users/andrea/.config/git/attributes': Permission denied

Perhaps the ownership of my .config folder was changed in mistake? Who should be the owner?

And if system should be the owner, is it safe to make it readable and writable by other users?

1 Answer 1

19

The .config folder is supposed to be owned by the user. It appears that the ownership got changed to system by mistake on your machine.

To restore the default permission, execute the following command:

$ sudo chown -R <username> .config

When prompted for a password, enter your login password.

Substitute <username> with your username. To determine your username, execute the following command and observe the output.

$ whoami

Finally, to answer your queries:

Who is supposed to be the owner of the .config directory under user's home folder?

The logged in user is supposed to be the owner of the .config directory.

And if system should be the owner, is it safe to make it readable and writable by other users?

It is not recommended to do that, unless you have some specific reason to do so.

5
  • I would have just one question: do you know any official source, or well-known reliable source, which states that config should be owned by the current user instead of system? If yes, could you post a link to it? Commented Mar 28, 2018 at 12:55
  • When I say this I mean also that it may not say it explicitly but it is easy to deduce this (for example, "all the standard subfolders of the home folder should be owned by the user") Commented Mar 28, 2018 at 12:57
  • 1
    There's no official document that I can think of, but the fact is a common knowledge. Perhaps this discussion from the Apple Support Community could provide an idea @AndreaCalliaD'Iddio
    – Nimesh Neema
    Commented Mar 28, 2018 at 13:02
  • Many thanks for the link, and just for a further confirmation that your answer should be right, I have also found [link] (askubuntu.com/questions/852265/…) question [/link] on AskUbuntu in which they still talk about this .config folder (but in a different OS) and they say that in Ubuntu it is also supposed to be owned by the user, so I don't see why MacOS should be different from this point of view... so unless someone disagrees and brings other sources, I will consider yours as the right answer... Commented Mar 29, 2018 at 10:34
  • 2
    A simpler reason of who the owner should be is that all things under your home directory are owned by you.
    – mmmmmm
    Commented Sep 26, 2018 at 11:01

You must log in to answer this question.

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