1827821 Members
2518 Online
109969 Solutions
New Discussion

umask

 
khilari
Regular Advisor

umask

Hi guys i wanted to know what is umask and how do u set umask?
Thanks
4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: umask

Have you read the 'umask' man page?

$ man umask

Also try here:

http://en.wikipedia.org/wiki/Umask
Todd McDaniel_1
Honored Contributor

Re: umask

umask basically sets the permissions that files are assigned when they are created by any user including root.

Typically there is a system default 066, if i remember correctly. Which resolves to 600 for the file created by a user. The umask is basically the opposite of what you want a file's permissions to be when it is created.

The default umask can be altered by setting it either in the /etc/profile for the entire system or each user can manage their own umask.

In /etc/profile or .profile, you can change the umask default value by adding a line:

umask 022

It is important to remember that the umask cannot assign execute permissions to a file. You must make it executable after the file is created if desired.
Unix, the other white meat.
skt_skt
Honored Contributor

Re: umask

umask for ftp is controlled separatly.
see
man ftpd
sandeep mathur
Respected Contributor

Re: umask



UMASK is a Unix environment variable which automatically sets file permissions on newly created files.

A reasonable value for UMASK is 022, which will cause files to be created with permissions of 644 (rw-r--r--) and directories to be created with permissions of 755 (rwxr-xr-x).

UMASK is nomally defined in the .profile or .login user startup files.