Questions tagged [umask]

umask is a Unix command to specify default permissions for the new files, created by the current user. umask is inverted ( umask 0 = world readable, writeable and executable).

umask is a Unix command to specify default permissions for the new files, created by the current user. umask is inverted ( umask 0 = world readable, writeable and executable).

It is used when multiple users produce some shared data but any user must be capable of overwriting this data.

The default umask is often selected so to 022 (only owner can modify the file but the group and the world can read) or to 002 (owner and group can modify the file, the world can read).

umask accepts the same bitwise mask as chmod command, but it is inverted: it specifies bits that must not be set. For instance

 umask 555
 touch t.tmp
 ls -l t.tmp

will result

 --w--w--w- 1 me 0 2013-01-25 09:11 z.tmp

(444 is the "write only" flag). By concept, the mask serves for removal of permissions (000 - nothing is removed, 777 - all removed).

Regardless of umask, the newly created files may not be executable, for instance on Ubuntu 10.04:

 umask 0
 touch x.tmp
 ls -l x.tmp

will anyway result

 -rw-rw-rw- me 0 2013-01-25 09:36 x.txt

even if the lowest (execute) bit is 0 in umask.

151 questions
0
votes
0 answers

Umask is not working

I have an odd problem with umask in ubuntu 14.04 I have added below line in /etc/pam.d/common-session session optional pam_umask.so I have also edited /etc/login.defs and change the UMASK line to UMASK 022 But while checking in command…
Rajib
  • 19
  • 1
  • 7
0
votes
1 answer

What should be the umask value to ensure that the extra bits cannot be set?

I am learning about UNIX, permission bits, and umask. What should be the umask value to ensure that the extra bits cannot be set?
RockOn
  • 197
  • 1
  • 19
0
votes
1 answer

Why does google app engine tell me that umask is not implemented in python on windows?

Does google app engine not support umask? I can use it in anaconda on windows, but when I try it in google app engine (running locally), it doesn't work. This code: import webapp2 import os class MainHandler(webapp2.RequestHandler): def…
Dan
  • 23
  • 4
0
votes
1 answer

Effect of umask on text files

I understand how umask works, at least a basic level, when dealing with the permissions of an executable file or directory. However, I struggle when it comes to how umask applies its rules to text files. For example, consider the umask 037. On…
user3277807
  • 63
  • 1
  • 1
  • 11
0
votes
1 answer

Setting umask with lftp in bash

I am trying to write a bash script to upload some files using lftp and need to set the umask to 002. I cant seem to figure out how this is done within the context of lftp. lftp -c "open sftp://$STAGE_FTP_HOST user $STAGE_FTP_USER…
Cluke009
  • 63
  • 1
  • 6
0
votes
1 answer

Jenkins file permissions of checked out files

I use the Subversion plugin for checking out. Checked out files are getting the permissions 750 (rwxr-x---). Can I change this somewhere? Thank you very much. whosit Edit: My system's umask is set to 0022.
whosit
  • 111
  • 4
0
votes
1 answer

Setting chmod value in Ubuntu for all newly created files

How can I set 777 to all newly created files in some directory? I have tried looking on google, but it's really confusing to me. Thanks in advance.
truе
  • 95
  • 1
  • 13
0
votes
2 answers

Where can I set umask for system account?

I have created a system account that's used by some process specifically. I want to set umask 002 for it. For regular user account, I usually put configuration like this in .profile. This approach is not suitable for system account, as .profile is…
tamakisquare
  • 16,659
  • 26
  • 88
  • 129
0
votes
1 answer

giving 2 diff users access to a folder

I need to give access to 2 users one with read access and other with write access to a particular folder(/folder). Both the users are supposed to be in the same group(sftp) user with read access: readsftp user with write access: writesftp I have…
user3407570
  • 125
  • 2
  • 11
0
votes
1 answer

UMASK, Virtualmin, WordPress and Ubuntu 12.04

I've deployed a new VPS with DigitalOcean. It's a standard LAMP stack and I'm testing a WordPress installation after creating a new "Virtual Server" in Virtualmin but it's UMASK is 022 and I need it to be 002. So I updated /etc/login.defs line 151…
Spencer Hill
  • 1,043
  • 2
  • 15
  • 38
0
votes
1 answer

file creation mask and umask

I was reading about file creation mask in a book and came across this: For example, if the value of the mask is 04+02+01=07 then the permissions normally indicated by these values are turned off whenever a file is created. So, with this value…
Guranjan Singh
  • 734
  • 2
  • 7
  • 24
0
votes
1 answer

umask for extra permissions like set group id on directories

How can I set the umask to make new directories with set-group-id flag as defaulte? (I use bash on CentOs6) I try: umask 5022 bash: umask: 5022: octal number out of range Or: umask 05022 bash: umask: 05022: octal number out of range Or: umask…
Udi
  • 117
  • 8
0
votes
1 answer

Uploading file to FTP using PHP - will not write to server

I'm trying to upload a file to an FTP server. It gets caught in the if statement which states that the directory must be chmode 777 however I have manually chmode 77 every directory in the ftp as well as adding a function in the code. Secondly, I'd…
FootsieNG
  • 809
  • 3
  • 12
  • 27
0
votes
1 answer

Debian FTP user permissions

I'm new to Linux and it's command line and I need to change user rights on FTP server. The situation is like this: I have a Debian server (without GUI, only with command line) with FTP server. And I have 2 users. Root (all access) and webmaster…
Racky
  • 1,173
  • 18
  • 24
0
votes
2 answers

Set owner:group and 770 chmod to apache2 created files

I would like configure apache to create files with personalized owner:group and chmod. I have an folder of website who need to be manipulated by apache + (ftp) user. Actually i do an (where 'mygroup' is group of ftp users) chown www-data:mygroup -R…
bux
  • 7,087
  • 11
  • 45
  • 86