Questions tagged [umask]

Umask is a value (the Ubuntu default is 022) that refers to those permissions that cannot be set by default when either a user or an application creates a new file.

Filter by
Sorted by
Tagged with
0 votes
2 answers
116 views

Why SSSD Service override_homedir triggers creation of home directory with wrong permissions?

I have a vendor application installed in an Ubuntu Jammy server that relies on SSSD v2.6.3 configured for LDAP integration for the authentication and creation of the home directory of the user in the ...
Alejandro Arévalo's user avatar
0 votes
0 answers
20 views

Problem with umask [duplicate]

I put the following mask: "umask u=rw, g=x. After that I create a file on the desktop, but for some reason there are no execution rights for the group. To give the group execution rights is ...
JCPP's user avatar
  • 1
0 votes
0 answers
170 views

umask 027 and the sudo user

This is sort of a follow on question to What permissions would change if I change umask to 027 from 022? Our IT has changed umask from the default 022 to 077 and then to 027 after enough complaints ...
schrödinbug's user avatar
0 votes
1 answer
613 views

Please help me understand effect on file permissions on combining umask an ACL and Samba create mask

I set up an ACL in /media/4TB1 My intention is to enforce these two points: All sub-directories of /media/4TB1 will have permissions: drwxrwxr-x i.e: chmod 775 All files will get permissions: -rw-rw-...
FlexMcMurphy's user avatar
1 vote
1 answer
94 views

Why doesn't "umask" work here?

I want to set umask to 343. I calculated that the permissions of the newly created files should be: -wx-w--wx but I get: -r---w-r-- My terminal: meliwex@reverse-proxy:~/testfolder$ ls -l total 0 ...
Hayk's user avatar
  • 623
0 votes
0 answers
478 views

How to set umask for the user in linux permanently

Any other alternative where to set umask in linux permanently without modifying the bashrc/ profile files
mahesh_1's user avatar
  • 101
5 votes
1 answer
549 views

Why does a user's umask values differ between two systems?

I have two systems, A and B. A is Ubuntu 16.04, and B is Ubuntu 20.04. Each has a utility user 'rufus' defined on it. 'rufus' has no login on either system. I want to understand why 'rufus' has ...
Borea Deitz's user avatar
0 votes
0 answers
196 views

Any directories I create have permission 777

Anytime I create a directory (with mkdir, or if git creates it, etc) it's given these permissions: drwxrwxrwx 2 username usergroup 2 Apr 6 20:36 test/ I'd rather have permissions of ...
Sam's user avatar
  • 59
0 votes
3 answers
1k views

What determines default directory permissions? [duplicate]

In Linux when I create a directory mkdir newdir then the newly created directory has these permissions and ownership: drwxr-xr-x 2 owner group My Question How can I make the default permissions for ...
FlexMcMurphy's user avatar
0 votes
0 answers
64 views

umask (octal form) and umask -S (symbolic form) outputs are different. why? [duplicate]

Related to file and directory permissions and umask: Why the command umask (shows the octal form) and umask -S (shows the symbolic form) show different (actually the option -S shows the bits negations ...
YAZ84's user avatar
  • 1
0 votes
0 answers
216 views

How to set umask for daemon only in ubuntu 18.04?

I am working on OS hardening tasks. Need to set umask value for all the daemon processes running in the ubuntu system. It would be great if someone can share the steps. Note: umask need not be set for ...
Karthik Joshi S's user avatar
0 votes
2 answers
384 views

What are the consequences after accidentally executing umask 077 in folder /etc/apt

I accidentally executed umask 077 while in the folder /etc/apt. What are the consequences of this? Could I have broken something? How can I undo it?
jayden's user avatar
  • 31
-1 votes
1 answer
81 views

why doesn't mkdir -m 07 test use umask?

umask returns 0011. Consequently, when I do mkdir -m 07 test I'd expect the resultant directory to have d------rw- permissions but it doesn't - it has d------rwx permissions. What's up with this?
neubert's user avatar
  • 211
1 vote
1 answer
408 views

How to reliably set umask on Ubuntu 19.10? SOLVED (for 20.04&20.10 also)

I have set up a new computer running Ubuntu 19.10. Now I want to set default permissions to be more restrictive via umask, but fail to do so. I tried setting umask with every advice I could find here ...
dTerm's user avatar
  • 11
1 vote
1 answer
2k views

umask not work on ubuntu 19.10

everybody, i have found some postings about this problem but none of the solutions work for me. I want to set the UMASK system-wide on 007. I am using Ubuntu 19.10 with the default desktop. I have ...
Sven Gehr's user avatar
0 votes
1 answer
1k views

umask's full path and runing it as different user

Today i learned about the command umask and it returns 0002 for my default user. I wanted to see its value for the root user, so I executed sudo umask and it returns: $ sudo umask sudo: umask: command ...
Anas Tiour's user avatar
0 votes
1 answer
3k views

default permissions for specific directories (home directory)

asumming a system where only 1 new user was added and was given root (administrator) privileges. we want to keep the user files within the user home directoy safe, meaning the no other user (except ...
Mr.'s user avatar
  • 415
1 vote
2 answers
1k views

Making all folders not readable to "others" - but keeping their original status regarding "write" and "execute"

TLDR: How can I change permissions of all folders in the computer such that, for "others", the folders loose only readability? In other words, they keep their status regarding "write" and "execute", ...
Jorget Millani's user avatar
1 vote
0 answers
926 views

umask settings in Ubuntu 18.04

For system-wide umask setting I edited "/etc/pam.d/common-session". session optional pam_umask.so umask=027 It doesn't have any effect. It does work on Ubuntu 16.04. I don't know why this won't work ...
Smile's user avatar
  • 1,099
2 votes
1 answer
2k views

Why USERGROUPS_ENAB property in /etc/login.defs does not have any effect?

I just found the following comment in /etc/login.defs: # Enable setting of the umask group bits to be the same as owner bits # (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid ...
Nicolas's user avatar
  • 847
1 vote
1 answer
66 views

Default mode bits for a network share?

I have a software RAID array set up on PC with Ubuntu 16.04 Gnome, with the resulting /dev/md0 formatted as EXT4 and mounted as /RAID. I'm using Samba to share various directories from this machine's ...
Strobelight's user avatar
2 votes
1 answer
7k views

Is setting umask to 000 dangerous

I know that setting umask to 000 causes potential security issues. I don't care. I only want to know if something bad happens if I do it as root (sudo umask 000), or in /etc/init.d/rc script. By ...
banan314's user avatar
  • 340
2 votes
1 answer
241 views

What command can you use to quickly find which file on your home folder containing the umask command? [duplicate]

What command can you use to quickly find which file on your home folder containing the umask command? $ grep -rnw "umask" ~
user avatar
0 votes
0 answers
336 views

Why umask in C program doen't work as expected

I have the following code comes from the apue book: #define RWRWRW (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) int main() { umask(0); if(creat("foo",RWRWRW)<0) err_sys("...
Sut's user avatar
  • 19
0 votes
1 answer
1k views

Umask settings for users=rwx, group=r, others=

How can i set the umask in ubuntu for permissions like this: users = rwx group = r others = I tried this mask, but it didn't work: umask 011
user avatar
4 votes
2 answers
926 views

Permission problems installing with sudo between 14.04 and 16.04

I have run into many permissions problems installing packages in 16.04. I install them using sudo, but then normal users cannot read the files in the package. So I ran a simple test: I created a ...
kingaj's user avatar
  • 143
1 vote
0 answers
172 views

Why is the umask number not the same for different local users?

For one of my local users, "ram", the umask is 0002. Another user, "yas" has the umask value 0022 instead. Shouldn't all users have gotten the same umask setting on their creation?
1Deag Wonder's user avatar
1 vote
3 answers
3k views

Why umask 555 is setting the file mods to "222" instead of "111"?

I know that: A file default mod is 666 umask value will be removed from default mods. So why when I set the "umask" to 555 it doesn't set newly created file's permissions to 111? instead it's ...
Ravexina's user avatar
  • 55.4k
8 votes
7 answers
21k views

How to set default umask in Ubuntu 17.04?

In the past, I have always set umask at ~/.profile. I set a umask of 077 so my documents get a permission of 600 (rw-------). But setting this at ~/.profile no longer works in Ubuntu 17.04. So as new ...
G.W.'s user avatar
  • 633
2 votes
1 answer
3k views

Why is UMASK set in /etc/login.defs ignored?

I have set UMASK 077 in /etc/login.defs and there is no override in ~/.profile or ~/.bashrc. The umask command still prints 0022 in gnome-terminal, but prints 0007 when I log into tty1. Newly created ...
Chandra Sekar's user avatar
13 votes
3 answers
41k views

How to change umask mode permanently?

I've read a couple of articles like this old one how to change umask mode but still can't figure it out 100% I have Ubuntu 14.04 running with Xenial kernel with default umask 0002 and my aim is to set ...
JoKeR's user avatar
  • 6,972
1 vote
1 answer
525 views

umask leading 0

My umask is currently (default) set to 0002, as shown below. I understand that the permissions from right to left are, other, user, owner. So what is the first 0 for? $ umask 0002
john smith's user avatar
  • 3,013
2 votes
1 answer
1k views

Issue with umask UBUNTU 14.04.3

I am new to UBUNTU As per our security policies Umask value for each user must be as restrictive as possible: • for “root”: at least 077. • for other users: at least 027. I have set umask as 0077 ...
Nidhi's user avatar
  • 271
1 vote
2 answers
5k views

Setting files and directories to match umask setting recursively

Is there a way to go into my home directory and recursively set files and directories to match my umask setting? The issue is, way back when I started using linux, I didn't understand permissions. In ...
Don Fink's user avatar
1 vote
1 answer
107 views

Umask on the command line

Where can I go to set a umask for any new users I create through the command line? I think it's through the /etc/.profile but I'm not sure.
Miriam Van Den Hout's user avatar
6 votes
1 answer
3k views

Why doesn't umask work as expected?

Please, can someone explain this to me? I set: umask 000 touch afile.tmp result: -rw-rw-rw- 1 jay apache 0 Aug 16 18:11 afile.tmp I was expecting this: -rw-rw-rw- to be like this: -rwxrwxrwx ...
Ted's user avatar
  • 955
6 votes
1 answer
2k views

Why does my umask keep resetting to 000?

When I login anew my umask is 002. At least for a while. Then at some point, and I'm not sure when, it reverts to 000. This is very inconvenient and I'm now constantly living in fear of dropping files ...
Miles's user avatar
  • 180
0 votes
1 answer
756 views

How to Create Text Files with user execution bit set automatically [duplicate]

The closest I got was umask to change the default permissions set for files/folders. However, umask doesn't seem to allow enabling the x bit for files: The base permissions for directories are 0777 (...
bazz's user avatar
  • 171
5 votes
2 answers
48k views

What permissions would change if I change umask to 027 from 022?

I have just started using Lynis (please don't think I have misspelled Linux). After running it, I was suggested to set umask in /etc/login.defs and /etc/init.d/rc to 027 than the default 022. I want ...
Registered User's user avatar
3 votes
1 answer
451 views

Ubuntu 12.04 Server - Default directory permissions

I am new to linux and I installed linux for web server purpose with apache2. I have created a new directory /var/www/mysite. My main problem is that each new file I create has read only permissions ...
nimi's user avatar
  • 131
2 votes
2 answers
869 views

How to set the umask in 13.10?

Apparently, there's a bug in Upstart that's shipped with Ubuntu 13.10, which overrides the umask set either through $HOME/.profile or /etc/login.defs. Upstart has been updated to fix this in Trusty, ...
fohswe's user avatar
  • 536
0 votes
1 answer
405 views

new file default execution permission? [duplicate]

I can't figure out why I don't have execution permissions on files I create by default. I don't think I messed with any Ubuntu permissions, it's pretty default stuff. When doing some research I found ...
Farzher's user avatar
  • 295
0 votes
2 answers
3k views

Can I set a specific group|umask to be the default one for all actions within a certain path?

I would like to override the default umask and owner:group settings within certain directories only, without requiring root privileges, as that kind of defeats the purpose. For example, when I touch ...
Redsandro's user avatar
  • 3,674
12 votes
2 answers
72k views

Why does umask 077 not allow the user to execute files/directories?

I'm using umask 077 ."Other" and "group" do not have any rights, but the user can't execute files/directories. Why does umask 077 not allow the owner to execute files/directories?
Just me's user avatar
  • 121
7 votes
1 answer
4k views

How to make a directory with permanent permissions different from default

I have system-wide default permissions set with umask 027. I am in the need to make a directory whose sub-directories would need 775 permission and whose files would need 664 permissions and make ...
Cormite's user avatar
  • 151
3 votes
0 answers
1k views

Wrong permissions on "make install" [closed]

When I compile and install tarballs using the usual ./configure, make, sudo make install, the files and directories created always have wrong permissions. In particular, nothing that should have the ...
koschei's user avatar
  • 131
236 votes
7 answers
484k views

What is "umask" and how does it work?

I believe that umask is something that controls file permissions, but do not fully understand it. After running umask 0644 in a terminal, I cannot read the files I create with the command-line text ...
Lekensteyn's user avatar
  • 174k
46 votes
6 answers
194k views

How to set umask for a specific folder

I need to set the umask value for one specific folder. I have a web application and when it creates some file the default permission is 700. But I need at least 755 permission for that file. How can ...
Bakhtiyor's user avatar
  • 12.2k
2 votes
1 answer
1k views

Firefox downloaded files permissions

My umask is 0022, but when I download a file (using Firefox 40b11) it is created with umask 0026 (-rw-r-----). No clue where the issue is, if I'm even asking in the right forum. I'm on Mint 10 (sorry, ...
ultracrepidarian's user avatar