What controls the default permissions is known as the
It depends on how the file was created, because various daemons can be configured to use a different default
umask. So creating a file by a samba/cifs share, or via sftp, or by logging in interactively and using
touch or creating a new file by saving in some text editor like
joe or whatever can all end up with different permissions, even if the files are created by the same user in the same directory.
In the same vein, there is also the ownership of files/directories created. The system default is probably the owner is the creating user and the group is the creating user's primary group. But be aware that other file permissions can affect this (ie, the
setgid bit on a directory) as well as various daemon configuration options just like the