Issue :

When a new file is created by the user, the default permissions are set to ‘666’ . How can it be set as ‘644’ by default?

Fix :

Default permissions are handled by ‘umask’. A umask code of 022 means that all new folders that will be created will have the permissions 755 (777-022 =755) and files will have 644 permissions (666-022=644).

The current ‘umask’ value can be seen by issuing the following command :

# umask

To set the umask value server wide, edit the /etc/bashrc file and if you want to set it for a particular user only then put it in his .bashrc file.


Shares
Contact Us On WhatsApp