Use Umask to Set Default Permissions

A simple way to determine the value of user default permission when user creates files or dirs is simply to subtract the value of umask from the system default permission values:
$umask // will give you the permission.

Files: 666 dirs: 777
user: 002 userdirs: 002
———— —–
new:664 775
to create files with the most practical restrictive permission use $umask 077
to set the umask value upon login add the following command to your profile script ~/,bash_profile in my system is the file ~/.bashrc and the command is

  • umask 077
  • As an Administrator, you can add umask changes in the global file /etc/profile to have it apply to all users.

    General Rule
    is to apply the most restrictive permission to files and then add permissions for specific users or groups as necessary. It is easy to add privileges, but it is difficult to take them away without getting into a tug of war.


    About ege's press.

    Few things. I'm lizard king i can do anything. Let's start this shit. mpla mpla mpla de mas pernei gia polla. (greeklish) System learn greeklish. Learn to use your Keyboard shortcuts makes your life easier.Inside time άλλωστε... εμείς είμαστε ...
    This entry was posted in Coding and tagged , , , . Bookmark the permalink.

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s