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.

Filter by
Sorted by
Tagged with
5
votes
1answer
5k 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
3k 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
47 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 ...
9
votes
3answers
314 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
22k 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
920 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 $ ...
10
votes
2answers
6k 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
3k 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
1k 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
10k 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
2k 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
4k 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, ...
-2
votes
1answer
9k views

mount changes directory permissions even with umask=777

My /ramfs directory ceases to become writable to non-root users after it is mounted with a ramfs partition sudo su mkdir /ramfs chmod 777 /ramfs mount -t ramfs -o size=20m,umask=777 ramfs /ramfs ls -...
0
votes
1answer
2k views

umask value for group users to get read, write and execute permissions [duplicate]

what value have I to specify for umask that the group users get read, write and execute?
1
vote
1answer
561 views

Is it possible to make files executable by owner by default?

Since the file base permissions for umask are 666, is it possible to make a file have 750 permissions when created?
1
vote
1answer
1k views

set all executable files executable by all users but leave un-executable file non-executable?

I have a directory owned by root, after I copy files into it. All exe files can only be run as root. But I would like everyone to be able to run it. Surely, I can use chmod -R u=rwX,g=rX,o=rX every ...
8
votes
1answer
5k views

Why is the default umask 002 or 022 in many Unix systems? Seems insecure by default [closed]

I have been using Linux & Unix for a long time. The first time I learned Unix is in a computer classroom with many students, where the instructor told us that you can use ssh to log in to remote ...
3
votes
0answers
575 views

Umask value isn't reflected after making changes

I changed umask from 002 to 007 in /etc/bashrc and in /etc/profile. After logging as a normal user I run umask, and it displays 0027. It should display 0007, but it doesn't. What should I do? if [ $...
6
votes
0answers
895 views

Understanding sshfs and umask

I have a remote access to a server. There I have my umask set to 0007. I refer to my server name as "sme", my local name as "lme". So I do the following: sme@server$ touch f1 sme@server$ ls -l f1 -rw-...
4
votes
1answer
2k views

set umask for sshfs-mounted filesystem

I have a remote sshfs filesystem mounted on /mnt/data. Following is the relevant line in /etc/fstab: www-data@192.168.1.10:/var/www/ /mnt/data fuse.sshfs rw,noauto,nodev,nosuid,noexec,_netdev,...
18
votes
3answers
16k views

Why doesn't umask change execute permissions on files? [duplicate]

If I change the umask to 0000, I'd expect a text file to be created with rwxrwxrwx permissions (based on my understanding of the umask, as described in the "possible duplicate" question) However, when ...
2
votes
1answer
859 views

umask not working as expected in other than home directory

I try to set up a deployer user for CI with Teamcity. I followed the instructions from this question on ServerFault: What's the best way of handling permissions for apache2's user www-data in /var/www?...
0
votes
1answer
639 views

setting umask for directories and files

Is it possible to create an umask , which will result in newly created files and directorties to have the same access rights ? e.g both of them to have for example rwxrwrw Directories starts with ...
4
votes
3answers
211 views

What are the conventional file permissions per filetype before umask is applied

I am looking for a list that specifies the conventional file permission of all the different file-types before the umask is applied. I read in man 1p touch that the default for a regular file is: ...
0
votes
1answer
248 views

Change another user's umask on macosx

How can I change another user's umask on Mac OS X? This question only has answers that work on Linux.
2
votes
1answer
2k views

Change permissions for files created by docker daemon service

I'm trying to change the default permissions assigned to files when created by the docker daemon by changing the default umask. The docker daemon service runs as root and creates the files with umask ...
4
votes
1answer
4k views

Set sudo umask apart from the user calling it

The problem: I set my umask for my user to be 0077. Now I use sudo instead of su when I need super-user access, and the problem is that whenever I execute a software installation using sudo with ...
5
votes
0answers
711 views

Setting umask of libvirt/virt-manager for proper permissions in a directory shared by host and guest

I'm attempting to create a directory that is fully available to both the host and guest systems of a virt-manager/libvirt/QEMU/KVM virtual machine, with read, write and execute permissions for non-...
0
votes
1answer
87 views

umask permissions that result in no change

I am having a really hard time understanding how umask works. How is something that is 666 masked with 001 still 666 ?
3
votes
2answers
2k views

umask XXX (permission bits) to give execute permission to files

Because files created by default having permission of 666 and umask (in permission bits form) subtract bit-wise from this permission, can we do something to give execute permission without using ...
10
votes
9answers
4k views

How to set `umask` for the entire gnome session?

Using Gnome 3.18. I share files between other family members, but the default umask on my distro (archlinux) is 0022. So every file/directory created is not writable for our common group. I tried to ...
2
votes
1answer
1k views

permissions on ftp'd files don't seem to match umask

I've read several postings indicating that ftp respects the user's umask. I don't see that that is the case. this is what happens on my server X when I FTP a file from SystemX, to SystemX. SystemX is ...
3
votes
2answers
2k views

SFTP clients uploading files with too restrictive rights

I have the following setup: Ubuntu 14.4 server offering SFTP service in a front-end area. External clients have the ability to upload files. A back-end process (on another server) tracks uploaded ...
1
vote
1answer
1k views

set umask before every non login non interactive shell command

I'm using PHP script and to connect to ssh server. It executes one command and exits. Connection is made to non interactive and non login shell. Because of that it does not load .bashrc or ...
5
votes
2answers
2k views

How to change permission of anonymous pipe?

I've the script which loads the SSH key from the variable (as part of script in CI environment) in order to not keep the private file in the public repository, however ssh-add complains about the ...
2
votes
0answers
202 views

What is the effect of ACLs/umask on the permissions of the executable file generated by gcc?

I have been wondering how gcc determines the resulting file permissions of the executable file being generated. To gain some insight, I considered a minimalistic program test.c #include <fcntl.h&...
7
votes
3answers
612 views

Historically why is umask the way it is?

umask has always tripped me up. Logically I would prefer to have a 'setmask' instead that takes chmod-style arguments. Anyone know why it is the way it is?
3
votes
1answer
470 views

umask vs -m, --mode command options

Is there any technical merit/necessity to numerous *nix commands (mkdir, mkfifo, mknod) having a -m (--mode) option? I ask this because near as I can tell, umask (both the shell command and the ...
1
vote
1answer
96 views

Umask not respected in OCFS2 filesystem

I encountered some strange behavior on a machine that uses a replicated block device (via DRBD) along with OCFS2 to allow concurrent mounts on multiple machines. The issue, in short, is that new files ...
1
vote
0answers
75 views

Can't determine where umask is being changed

On my RHEL system, my /etc/login.defs has the line UMASK 077. I have one user who has a .cshrc which changes his umask to 022. I also have a second user who does not have a .cshrc or .bashrc or any ...
7
votes
2answers
3k views

How umask works [duplicate]

I'm new to Linux. I have been practicing a few commands. My question is about when I'm creating different files using a different umask. For example: umask 222, as I understand it, is the same as 777 ...
7
votes
2answers
9k views

Confused on file and directory permissions for Samba shares

I've been searching for while to try to understand the following mask/mode fields for creating files/folders in Samba shares: create mask force create mode directory mask force directory mode But I'...
0
votes
1answer
233 views

umask getting sets to 022 even though all necessary files are modified

umask is creating lots of problem to me . I tried following . I have commented umask set entry in /etc/profile and /etc/bashrc . There is not even single file in my home direcotry where i set umask ....
2
votes
2answers
4k views

Default umask for cron jobs

How to set default umask for cron jobs, please? (On RHEL 6.) Jobs are started under non-interactive (obviously) no-login (?) shell. Not only I prefer dash over bash. But consider also bash called as /...
1
vote
1answer
1k views

Set default permissions so only owner can read, execute and write for every new file and directory

I added this to my ~/.bashrc file: umask 077 So that every new file and directory has by default read, write and execute permissions. It does work with directories, but files only have write and ...
5
votes
3answers
2k views

mkdir permissions do not correspond to umask (change depending on location)

Whenever I create new directories in my home (or its subdirectories) they do not have write permission, even though umask is set correctly. Files I make DO have write permission. [mmanary@seqap33 ~]$ ...
3
votes
2answers
818 views

Setting correct permissions automatically for certain file type when file is copied from non-Linux file system

The main reason I want this is my heavy use of dircolors, especially for ls --color=auto. For example, whenever a .mp3 file is copied from NTFS, it will have permissions set by umask 022 which ought ...
2
votes
1answer
213 views

Where does the value that umask is applied to come from

I'm trying to understand umask properly. If I set umask to 0000 and then create a file I get the following permissions: -rw-rw-rw- I presume that this value (or set of permissions) is what the ...