664 instead of 644

Sometimes on a new Linux server when you are copying files to, for them are assigned the permission 664 instead of the usual 644, and when you are making directories, them default permission is set to 775 instead of 755. Trouble is that the files and the directories can change not only the owner of them, but any other user who is in the same group on server with the files owner. Read in the article practical solution of the problem on the server Centos.
664 instead of 644 umask



Umask

When you are copying files to Linux and for them are assigned the permission 664 instead of the usual 644, it's mean that for the user umask is set to wrong value.

Resolve: go to the server via SSH as root and edit the file bashrc ...

[root@name-of-your-server ~]# vi /etc/bashrc

... search line in the file umask 002 (search in vim editor ?umask) and change it to umask 022 (start edit mode in vim - I or i, exit from edit mode - ESC)

After that save edited file bashr (save file and exit from vim :wq, exit without saving :q!) Changes take effect immediately, restart the server is not required.



HiTechBlog.net 2013-2024