Are there any files, like in ~/.config
or elsewhere, in the home directory that should be owned by root?
Will recursively changing the ownership of every file in my user's ~
to be my user be harmful?
Are there any files, like in ~/.config
or elsewhere, in the home directory that should be owned by root?
Will recursively changing the ownership of every file in my user's ~
to be my user be harmful?
Are there any files, like in ~/.config
or elsewhere, in the home directory that should be owned by root?
No you should be the owner of all the files and folders under your home.
What may be the possible trouble otherwise?
In your home there exists many user level settings for various applications and system itself in the hidden files and folders. If you
chown
them to root you will be in trouble in the next login. At the time of login your profile could not be loaded as you have no longer access permission to the configuration files. And you will be most probably kicked out to the login screen. In the process you will lock yourself.
Will recursively changing the ownership of every file in my user's ~
to be my user be harmful?
There is no harm in doing so. But keep in mind the case as pointed out by Lekensteyn in the comment above. I am quoting it,
Beware of rare edge cases when literally executing the command in the title, $USER and $HOME can be changed. E.g.
USER=nobody
;HOME=/
;sudo chown -R $USER $HOME
is unsafe.
There is a better proposal than to recursive chown
in the comment above,
you can find files not owned by you using
find ~ ! -user $USER -ls
(assuming a same environment where the variables have not been changed). And rename only those files.