My ubuntu default permissions suddenly changed from 644 to 664?
Usually, I am familiar with the permissions 644 and 755 for files and directories respectively.
But now when I create a new dir or a new file, the permissions are 664 and 775.
Is 664 and 775 the default permissions actually? But, I haven't noticed them before because I do not really look at file permissions every day.
Even folders created with nautilus do this. And, as there is no button to create a file in nautilus, I use the command line, and I am pretty familiar with the terminal.
I am using Ubuntu 20.10 Minimal Desktop version.
Now this is what happens:
$ ls -la
total 8
drwxrwxr-x 2 exampleuser exampleuser 4096 Mar 5 12:22 .
drwxr-xr-x 6 exampleuser exampleuser 4096 Mar 5 12:23 ..
$ mkdir example
$ ls -la
total 12
drwxrwxr-x 3 exampleuser exampleuser 4096 Mar 5 12:25 .
drwxr-xr-x 6 exampleuser exampleuser 4096 Mar 5 12:23 ..
drwxrwxr-x 2 exampleuser exampleuser 4096 Mar 5 12:25 example
This depends on the default umask which is different for normal users and the root user.
Check the umask for normal user:
which results in 775 for directories and 664 for files.
For the root user:
which results in 755 for directories and 644 for files.