Skip to content

Kali Debian Linux – How to calculate Umask

28/03/2014

To create default file permissions, we use umask.

Step 1 – is this a directory?  Use 777.

We subtract Directory rights from 777

Directory Rights = 777

Subtract Umask  = 022

Permissions given = 755

 

umask2

Symbolic permissions = RWX – RX – RX

 

 

Step 2 – is this a file? Use 666.

Files do not need execute rights, therefore we subtract from 666  (spooky number, right?)

We subtract files rights from 666

File Rights = 666

Subtract Umask = 026

Permissions given = 640

 

umask3

Symbolic Permissions = RW – R – –

 

Overview:

We SUBTRACT the umask value – to determine rights given.

We SUBTRACT the rights wanted – to determine UMASK needed.

 

 

777 – 007 = 770 (rwx – rwx – -)

umask

umask of 007, means that you and your group have full access, but the rest of the world are banned.

 

We’ve gone from 666 to 007, isn’t symbolism wonderful.

 

Advertisements
Leave a Comment

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: