Hi!
I accidentally set something wrong when I optimized my system.
Now all user rights in the home directory of files and folders are set to "write+read / write+read / read".
How can I restore to default?
"write+read / read / read"
I know that I can do the following:
chmod 0755 /home/user -R
I tried this before and then I shot up my user home folder.
Can anyone help me how to get back the default settings of the user rights in the home directory again?
Also when I create a file/folder in it with default permission 0755
write+read / write+read / read
Please help, thanks!
Hi @mate2go, You have the execute bit mixed in the 755. Did you mean 644 vs 664?
I ask because I think Ubuntu or Debian changed default from 644 to 664 sometime in the last decade. If someone knows this history, or setting location, please jump in.
I just tested both the touch command and Caja create 664 permissions in the home directory of 20.04.
system-wide UMASK is set in /etc/login.defs
I have this permission as default at the moment.
See picture here:

My old default permissions was...
See picture here:

When I create a file or folder in home directory, it have the
permissions of the first picture.
But my old default setting for my user account system-wide was as shown in picture 2 when I created a file or folder in the home directory.
Which is the right default permission and how can I get it back for my user system-wide?
Sorry, 664 is default for files. Default for directories is 775. That's obviously a directory.
You can set executable files to 775 but if it's not executable, funny things can happen in Caja when you try to "open" them.
I have a Ubuntu 8.04 VM (2008) and sure enough, defaults are 644 and 755 instead of modern 664 and 775.
I'll try to remember to talk files or directories as they are quite different. The file has "executable" while the same directory bits are "directory listing",
This may be what you're looking for. If you have any executable files they would need to be handled manually. However, for some reason, you want the old 755 / 644 combo. Executable files must be handled manually if you have any.
@ Bill_MI,
so 775 is default for folders and files 664 right?
default is not 755 for folders and for files not 644?
right?
That's what I see on 20.04 If I run a umask command it returms 0002 which corresponds to 775/664. You may be able to confirm the same value.
You can ignore the rest. My babbling... 
I did some investigating and /etc/login.defs has some info and UMASK is set 0022 so it is not the whole story. I did sudo -i to get a umask command for root and it is 0022 - different than my user. The info does say it is due to USERGROUPS_ENAB being set.
This thing is a lot more complex that it used to be! I don't think it's a big deal between those 2 options, anyway.
Thanks for the infos at Bill_MI 