Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [umask]

Mask that controls which file permissions are set for files and directories when they are created. It also refers to a function that sets the mask, and to the mask itself, which is formally known as the file mode creation mask.

0
votes
0answers
47 views

what is the significance of the ACL value being a complement of UMASK value?

From the description section of man 2 umask command, it says For example, the following default ACL is equivalent to a umask of 022: u::rwx,g::r-x,o::r-x What's the significance of having ...
0
votes
1answer
19 views

umask not applied when mounting from udev

I have a udev rule which automatically mounts usb device when connected The rule is the following one : # cat /etc/udev/rules.d/10-usbdetectd.rules KERNEL!="sd[a-z]*", GOTO="...
1
vote
0answers
42 views

Does Access Control lists override group or owner permissions?

I came across the following task: Add 3 new users - alice, bob, charles Create a new group - marketing - and add alice, bob and charles to that group Create a directory - /marketing - whose owner ...
3
votes
1answer
85 views

umask not being applied? [duplicate]

I am setting the umask to a new value as below. However although I am applying rxw to the user, this does not seem to be respected (?) /home/pkaramol $ umask u=rxw,g=rw,o=r /home/pkaramol $ umask -...
2
votes
0answers
29 views

Other has permissions with umask 007 on VM with mounted folder

One thing that's odd to me right now is I am playing around with permissions. The way umask works to my knowledge is it basically tells what permissions u g o don't have using octal representation (...
1
vote
2answers
268 views

How to get sftp to respect my umask setting

I'm trying to get sftp to give me a umask of 002 but it keeps behaving like the umask is 022. How do I get it to do that? Red Hat 7.4 /etc/ssh/sshd_config has the line: Subsystem sftp internal-sftp ...
0
votes
2answers
64 views

Is the umask function a kernel function?

I assumed the umask() function is a: shell function containing a variable commonly referred to as file creation mask but I was wrong because umask() is not a shell function and doesn't contain ...
0
votes
0answers
49 views

Zsh: force file/folder obey new umask

Default zsh shell uses umask 0022, when changing to new umask, e.g: 0077. Only new file/folders after changing to new umask are applied. How to use zsh/or-else to force old file/folder create under ...
1
vote
1answer
210 views

Is a file creation mask setted by a given shell's umask is typically unique to the operating system entirely or just to that given shell?

Is a file creation mask setted by a given shell's umask is typically unique to the operating system entirely or just to that given shell? For example, if I change the file creation mask (umask's mask/...
-9
votes
5answers
949 views

What is masking a mode? [closed]

I understand that in GNU/Linux, file permissions are also called a file's mode and that the term "umask" can mean at least these different meanings: The umask shell builtin command (the usual meaning)...
1
vote
0answers
58 views

Why is umask changeing

Problem: umask changes when new shell is created, despite what's in .cshrc On linux... In my .cshrc, I have "umask 002" At the prompt I see 2... % umask 2 I have a shell script... #! /usr/bin/...
0
votes
1answer
40 views

umask does not have -S option

I'm trying to use umask -S to show the current mask in symbolic form (per man umask on my system, which gives me the page BASH_BUILTINS(1)). But umask doesn't seem to behave as the manpage claims: ...
3
votes
1answer
656 views

What is the exact purpose of `mask` in file system ACL?

When I apply default ACL in a directory I see default:mask or just mask in the following two scenario. Scenario 1 -bash-4.2$ ls -ld test/ drwxr-x---. 2 test test 4096 Oct 15 19:12 test/ -bash-4.2$...
1
vote
3answers
444 views

How can I override the umask setting for all users for a specific folder?

I am running RHEL6. I have a requirement to have "umask 077" in my /etc/bashrc which I am not allowed to change. We have a folder designated for group collaboration where we would like everyone in ...
1
vote
1answer
206 views

Make user create 775 permission folders

I typed out the command chfn -o umask=002 souser and expected that souser user would create folders with 775 permission then but he did not. How to get that each new folder created by a certain user ...
1
vote
1answer
165 views

cmdline Unix Permissions bits calculator

I'd like to convert the Unix Permissions bits from octal to symbolic mode and viceversa. eg.: $ mode-encode 'ugo+rwx' 0000 $ mode-decode 0000 ugo+rwx I know there are online permission bits ...
0
votes
1answer
51 views

How do I make any newly created file in a specific directory executable, readable and writable by default by all users

The question that I am unable to find answer for is as follows: How do I make any newly created file in a specific directory executable, readable and writable by all users. So I've got an NFS, one ...
0
votes
1answer
513 views

umask in /etc/profile and /etc/login.defs

I don't understand how umask works in these two files: my machine doesn't use pam_umask module. If I change user and create a new file/directory, the umask used is taken from /etc/profile (the umask ...
2
votes
2answers
172 views

chmod , umask, acl

I think the answer is "That's just how it works," but I figured I'd ask in case I'm doing something wrong. My account's default umask is 0077. I'm in the wheel group. I have a directory with this ...
-1
votes
2answers
93 views

What am I doing wrong with my linux commands? [duplicate]

I want to inherit every new file from my group so that I can have execute permissions, and no one else, but when I try to create new ones, it gives me 664 permissions how can I fix this?? sudo ...
1
vote
1answer
690 views

Why is umask ignored when uploading files over sftp?

Have a wierd issue with permissions on files uploaded to a remote system. Locally, the file index2.html is chmod 664: acoder@acoder-local ~ $ ll index2.html -rw-rw-r-- 1 acoder acoder 29 May ...
4
votes
1answer
205 views

How to make autoconf use “install” instead of “mkdir -p”?

When I run sudo make install on a compiled package from the GNU archive, it uses mkdir -p to create the destination directories. I'd prefer it to use mkdir -p -m 0755 or install -d -m 0755 instead in ...
8
votes
2answers
2k views

Why do some umask values not take effect?

I'm trying to understand permissions better, so I'm doing some "exercises". Here's a sequence of commands that I'm using with their respective output: $ umask 0022 $ touch file1 $ ls -l file1 -rw-r--...
0
votes
0answers
82 views

umask and Naultilus [duplicate]

I seem to be having an issue with my applications not obeying the umask. in shell everything seems to be correct, i set my umask to be 002 in a sourced app_env.sh script. this is working correctly as ...
0
votes
2answers
70 views

File and directory permissions

I am learning umask command , and I get few questions. So: 1.For files and directories default permissions is 666 and 777 how can I config the default permission, specifically where is configuration ...
1
vote
1answer
273 views

Freebsd setfacl

I want on a dir,a default mask of --- for others on linux setfacl -d -m o:--- coldir/ works fine On Freebsd 11.0,with ufs2 setfacl -d -m other:--- coldir/ setfacl: other:---: Invalid argument ...
0
votes
1answer
609 views

Changing umask value

I want to change umask value from 022 to 002 for a particular user jboss. Right now it is set as follows in /etc/profile: if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then umask 002 ...
1
vote
1answer
135 views

Portable way to query umask for new file permissions?

I've been following a thread on OSS-Security called Security risk of vim swap files. It looks like Vim and Emacs caught a CVE because the editors created temp files in the wrong place with too many ...
1
vote
1answer
296 views

Cannot change the umask mode

I'm trying to change umask mode using login.defs config file but for some reason it doesn't affect the system. This is what I do: sudo nano /etc/login.defs # The ERASECHAR and KILLCHAR are used only ...
0
votes
0answers
157 views

Setting umask for a user with no shell?

How can I set the umask for the Apache user to have files default to -rwxrwx--- ? I have an application that wants one directory to have either 0750 or 0770 permissions, which is great if it’s local, ...
3
votes
0answers
48 views

Setting umask for GNOME session [duplicate]

I know there's a ton of questions about this topic but I'm not being able to find the right answer. I have GNOME Version 3.22.2 running on a Debian GNU/Linux 9 (stretch) 64-bit. The problem: I'm ...
1
vote
2answers
338 views

How to call chmod and preserve the SGID bit?

I have the following directory structure: + public/ |-+ pics/ | |-- a | `-- b `-+ thumbs/ |-- a `-- b I would like all the files in the tree to be owned by gallery:http with ug=rwX,o= mode set. ...
1
vote
0answers
86 views

issue of default file permission of user rhel 6

We have one network user and two Rhel servers. When we are creating file on server 1 using this network user, default permission of -rw-r----- is getting assigned to file but if same user is creating ...
1
vote
1answer
7k views

How to permanently change umask value from 0002 to 0022?

My current umask value is 0002 $ umask 0002 $ I want to permanently change it to 0022 How can I do so?
0
votes
1answer
824 views

Umask to make default permission 750

I'm working through questions from Unix The Textbook. I'm trying to solve the question (chapter 8, #15, page 207): Give a command line for setting the default access mode so that you have read, ...
0
votes
1answer
192 views

tar extracts with invalid permissions - is it an intended behavior?

Recently a tar.gz archive broke my script. Steps to reproduce: # this is a Python package distributed through PyPi wget https://pypi.python.org/packages/b3/e8/...
4
votes
1answer
2k views

Umask not working [closed]

I'm trying to figure out how to use umask. I ran umask 027 expecting this would result in all permissions for myself, read and execute for group, and none for everyone else. Based on a default of ...
3
votes
1answer
1k views

Set umask for systemd unit

I am running rsync daemon with a specific user on Ubuntu machine. The problem is that since daemon users don't login, the umask set for the user is the default one. How do I set umask for the user in ...
1
vote
2answers
34 views

See permissions for new files on a given directory

I don't understand how my Linux machine is operating on new files. I have an Amazon Linux AMI (RHEL based distro) and when I execute umask I get 0002, so I get whenever I create new stuff other ...
8
votes
1answer
257 views

Permissions on Files:

I would like to give 755 permissions to a directory, so I use: # chmod -R 755 /my/folder/ It works for all files inside my folder, but the problem is that I use scripts that create new files in this ...
4
votes
2answers
19k views

My machine has no hostname “Failed to start hostname.service: Unit hostname.service is masked.”

I was trying to change the hostname on my machine according to this article: https://www.blackmoreops.com/2013/12/12/change-hostname-kali-linux/ When I got to the part service hostname.sh stop sleep ...
0
votes
2answers
2k views

How to umask to get default file permission of 755?

I don't seem to be able to use umask to make sure my default file permission is 755. I need it because every time I check out a script file on CentOS from my version control, it doesn't have the x ...
0
votes
1answer
608 views

Leading zero in umask 0022 [duplicate]

How can I change leading zero in umask 0022? Can it be changed? I searched the usual methods for information and my local system was of little help. $ man umask No manual entry for umask $ ...
8
votes
2answers
4k views

What is the first digit in umask value? [duplicate]

If I understand correctly file permissions have an associated 3 digit number which specify read/write/execute permission. The umask value is a default 'mask' which is subtracted from the default ...
1
vote
1answer
2k views

Not able to upload as anonymous user in vsftpd

I have vsftpd running on Ubuntu 16.04 LTS. During installation a ftp user is created with a home directory of /srv/ftp and hence this is the default FTP directory. Here are my vsftpd.conf file ...
0
votes
1answer
1k views

Force new files to have permissions 660 instead of 600?

There is a particular program that creates files and directories with permissions 600 and 700, respectively. It creates them within its own working directory, /home/me/program. I want those ...
1
vote
2answers
927 views

what is significance of first digit in 0022 when I run umask on linux? [duplicate]

I know that there is no difference in 0022 and 022 referring to link. I have file 1.c, with permissions 0066. But when I change the mode of file 1.c to 1066, and then when I check the permissions of ...
3
votes
2answers
5k views

Different Umask for Directories and Files

How can I set up a different umask for directories then files? I need dirs with umask 003 and files with umask 117
0
votes
2answers
1k views

Setting umask for su user command

In my system I set the umask for the user root to 0077 and for the non-root users to 0027 (via /etc/profile). This is working for the normal terminal logins. But if I login as root and change user ...
1
vote
1answer
3k views

How reasonable to make ansible work on systems with restrictive umask?

Q1. If you setup root with a restrictive umask, it will affect the files created when you run ansible, right? (Unless you tell ansible to ensure a specific mode aka. permissions). A1. Looks like it, ...