Questions tagged [umask]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

I cannot find where 0002 umask is being set on Ubuntu 20.04

My user account has a non-standard umask setting of 0002, and I cannot find the config file where this is being set. I have searched in /etc and ~/.bash* with sudo grep -iIr umask. Running umask in ...
Lisanna Dettwyler's user avatar
1 vote
0 answers
54 views

How are Linux ACLs different for files versus sockets

With umask 0022, using default ACL entries default:user::rwx, default:group::rwx, default:mask::rwx and default:other::rwx for a directory, files created with touch (e.g.) have a mask of rw, and ...
Larry's user avatar
  • 11
2 votes
1 answer
989 views

Debian umask defaulting to 0077

I only noticed this because when I installed tree it noted /usr/bin/mandb: can't search directory /usr/local/man/man1/: Permission denied. I checked /usr/local/man/man1 and confirmed that it's set to ...
bankman22's user avatar
0 votes
1 answer
331 views

Remote ssh login does not respect pam umask

My server is on Ubuntu 22.04.1, and recently I discovered that the result of the umask command is 0002 instead of 0022 in an SSH session (non-root), which is odd because I have not messed with any ...
tearfur's user avatar
2 votes
1 answer
627 views

Remote command has different umask

ssh user@host "umask" gives 0174 ssh user@host and the umask from server shell gives 0002 Could you please explain how can it happen? UPD: Actually, it was /etc/passwd overriding umask.
Oleksiy Svintsitskiy's user avatar
0 votes
0 answers
2k views

Setting UMask in systemd override.conf is ignored

I'm using amavisd on fedora33 and trying to change the file permissions on the socket it creates so nagios and nrpe can read the file in the amavis group. The file permissions currently are as such: # ...
Alex Regan's user avatar
6 votes
2 answers
5k views

Unable to set umask for Ansible tasks

I'm trying to run an arbitrary Ansible module with a specific umask (0002). Some Ansible modules (like git) support a umask parameter (or a mode parameter to set permissions directly), but many do not....
Aljoscha Vollmerhaus's user avatar
-1 votes
1 answer
2k views

setting umask for a directory so that all directories, executable file(.sh , .cmd, .bat) are 750 and regular file 640

need to create and change existing file and directory such that all directories and executable files(*.sh, *.bat, *.cmd ..) are 750 and regular file are 640 . I need to this in shell and python both. ...
user1656899's user avatar
0 votes
2 answers
465 views

linux/lighttpd: setting umask for webdav?

I'm running lighttpd on my linux server. I have set up webdav, and I want to set the umask to a specific value only for the webdav site, and not for any other sites running under my lighttpd server. ...
HippoMan's user avatar
  • 230
1 vote
1 answer
2k views

How to set umask for Apache on Amazon Linux 2 AMI

I want to set umask 0002 for Apache httpd so that certain files that it creates will be writable by other users. The traditional solutions don't seem to work on Amazon Linux 2 AMI.
dln385's user avatar
  • 121
0 votes
2 answers
67 views

Different software saves files with different file permissions

I've got bizzare issue. There's a dir created by me with permissions 755. I'm working with a piece of software. After I'm done I save the output of my work to the same folder. Files get saved with ...
excessive's user avatar
0 votes
0 answers
236 views

DEBIAN SFTP change UMASK not working

I have a user let call him bob connecting via sftp with bob account. using for client ftp-kr in VSCODE(osx) and server debian 9, I would like to setup a umask like for ftp service. I tried adding ...
jotyhista's user avatar
1 vote
1 answer
2k views

set umask 000 on Windows?

Sorry if this sounds like a dumb question, but don't have a lot of experience with NFS and Windows together. I have a user on a Win10 ENT box, connected up to a FreeBSD server. And with the Macs, when ...
LoonyD's user avatar
  • 23
0 votes
1 answer
4k views

How do I get a server side umask to be honored in scp -r when creating directories?

I am trying to setup an scp receiver that allows select users, based on ssh keys, to scp files to a specific server as a user different than themselves. This is to satisfy access restrictions by ...
The Veritable Bugeater's user avatar
0 votes
0 answers
517 views

PHP error logs and files being created with different umask

I have the umask set up on my Apache2 server using umask 002. This is added to the end of /etc/apache2/envvars during the docker container build. I have the following script to test: // Create file ...
Wildcard27's user avatar
3 votes
1 answer
4k views

debian internal-sftp -u 0002 umask does not work correctly - execute permission missing

I've been searching here and but I could not find similar question. I have set up SSH and sftp server on debian 7, the problem is that the umask is applied without execute permissions. Even if I ...
oglop's user avatar
  • 261
1 vote
1 answer
1k views

NFS files and directories created with wrong permissions from MacOS client

I have a simple NFS share setup on CentOS 7 to allow my Mac to manage files in the /var/www/html directory: /var/www/html 192.168.1.107(all_squash,anonuid=1000,anongid=1001,rw,sync) Files and ...
Craig Jacobs's user avatar
3 votes
1 answer
11k views

Which umask is more secure in Linux ( 022 or 027)?

Is there any security concerns if the umask is set to 027 for root (Basically I want to know if 027 is better in security than 022 ) ? As per my understanding 027 is a better one from security ...
Mathews Jose's user avatar
2 votes
1 answer
2k views

Set umask 0002 for apache user: www-data

I'm running ubuntu 14.04 and would like to have apaches www-data user to create files that are writable by all users within that same group www-data. So far I've tried to add umask 0002 or umask 002 ...
jrn's user avatar
  • 123
-1 votes
1 answer
674 views

Why are newly-created files under /root not executable even though /root is and umask is 022? Is this the default on CentOS? [duplicate]

I am building a small set of utility bash functions and aliases that will live on a special /root partition. I've noticed that whenever I touch aFile or vim aFile, the result is aFile with the ...
tacos_tacos_tacos's user avatar
0 votes
1 answer
192 views

using umask to set default file settings [duplicate]

I am setting default umask of linux box for the first time. I log in as root user on a Centos 6 server. I want these default values: owner: read/execute/write (7) group: read/execute (5) other: ...
user747's user avatar
2 votes
0 answers
526 views

nginx passenger, setting the umask

I was wondering how to set the umask for nginx or passenger or both processes. A search seems to only bring up Apache. Any help would be very much appreciated! (This is on Debian.)
Cenoc's user avatar
  • 217
1 vote
0 answers
251 views

openssh sftp server file permissions not being set by umask (but folder perms are)

I am running the openssh sftp server like so: Subsystem sftp /usr/libexec/openssh/sftp-server -u 002 And the folders I upload via sftp get these permissions: drwxrwxr-x 12 developer staff ...
Christof's user avatar
  • 121
0 votes
1 answer
1k views

internal-sftp -u 002 is ignored for copied files

I configured OpenSSH like this Subsystem sftp internal-sftp Match Group sftp ForceCommand internal-sftp -u 002 AuthorizedKeysFile /home/sftp/ssh/%u ChrootDirectory %h ...
RafaelKr's user avatar
  • 101
1 vote
1 answer
13k views

SFTP clients not respecting default UMASK permissions [duplicate]

Here's my situation: I'm setting up an Ubuntu 14.04 web server for a team to share. I'd like the team to have read/write access to everything inside var/www/html (same as CHMOD 775 on every file and ...
Marcelo Somers's user avatar
5 votes
1 answer
2k views

Any way for openssl to generate private key with 400 (-r--------) permissions from the start?

I use openssl to generate private keys and CSRs in a script. The script needs to generate the key first, then call chmod 400 whatever.key to change the permissions of the private key to something ...
thomasrutter's user avatar
  • 2,576
5 votes
3 answers
4k views

Proper Way of Setting Umask For php-fpm on Debian/Ubuntu

I'd like to set umask to 002 for the php-fpm process. I'm reading here and here that on Ubuntu/Debian it is supposed to be done by modifying the init script. I'm having doubts however that this is ...
Attila Fulop's user avatar
2 votes
1 answer
113 views

Should usergroups be enabled?

All our users are managed with a central LDAP. When my predecessor in managing the infrastructure created the ldap he decided against creating usergroups (meaning groups of the same name and GID as ...
Clemens Bergmann's user avatar
4 votes
1 answer
5k views

SFTP-server uploaded files having wrong rights

I have been trying to figure out what is wrong with the file rights. When I am uploading files using FileZilla all the files get rights -rw-r--r--. I would want them to have -rwxr-xr-x. I have tried ...
Firze's user avatar
  • 355
15 votes
1 answer
23k views

Does OpenSSH SFTP server use umask or preserve client side permissions after put command (chrooted environment)?

I know this question has been already discussed, but by reading the posts I could not figure the answers, because some said "yes umask can work", and others say "OpenSSH put command always preserve ...
drkmkzs's user avatar
  • 311
6 votes
4 answers
23k views

umask for www-data user running PHP on Ubuntu

Setting up a new webserver in Ubuntu 14.04 and trying to wrangle file permissions for PHP generated files. By default, all the directories and files in /var/www are owned/grouped to www-admin. ...
HorusKol's user avatar
  • 781
7 votes
3 answers
9k views

How to set umask for php-fpm in Fedora

I cannot find where to set umask (to set proper permissions to files created by php scripts) in Fedora 19. (specifically, I want new files to have the permissions 664)
leonbloy's user avatar
  • 2,148
-1 votes
1 answer
2k views

File base permissions are 666, why and is this a configurable value? [closed]

It is specified in various documentation on the net that linux/unix file base permissions are 666 with regards to how umask manipulates. This is also relevant with regards to the fact that default ...
MetaChrome's user avatar
0 votes
1 answer
3k views

How to set umask for php5-fpm in ubuntu 13.10

I am currently running nginx with php5-fpm on my local development ubuntu 13.10 system with 3.12.0 linux kernel. Before update, to set umask to 0002 for php5-fpm I edited /etc/init.d/php5-fpm file ...
baldrs's user avatar
  • 103
1 vote
1 answer
501 views

Debian - File Permissions and umask

This might be a noob question, but here goes ^^: I've just set up a debian wheezy server, and Installed laravel on it. Anyway, I'm having some trouble both as to what the file permissions should be, ...
Jazerix's user avatar
  • 111
4 votes
3 answers
5k views

rsync pull disregards my umask, why?

My umask is 0002. So when I rsync -r me@remote:new ., why aren't the results group-writable? drwxrwsr-x 10 root developers 4096 Aug 22 12:55 . drwxrwsr-x 12 root developers 4096 Jul 14 ...
Aaron Adams's user avatar
-1 votes
2 answers
3k views

Directory and files have 775/644 permissions but php says it is not writable?

I think this has something to do with ownership of the folders, but I have a php app that I am trying to get setup and I cannot install it because it tells me the permissions are not correct. I set ...
john h.'s user avatar
  • 135
2 votes
1 answer
1k views

Helping changing FTPD default umask

Default umask when logging in through FTP is 027 . I want to change this to 002 so a process with the same group can consume an uploaded file. Man 'ftpd' page says pass -u 002 to the ftpd command. ...
Will's user avatar
  • 441
6 votes
2 answers
16k views

Setting per-directory umask using ACLs

We want to mimic the behavior of a system-wide 002 umask on a certain directory foo, in order to ensure the following result: All sub-directories created underneath foo will have 775 permissions All ...
Yarin's user avatar
  • 1,366
4 votes
2 answers
15k views

Setting umask for all users

I'm trying to set the default umask to 002 for all users including root on my CentOS box. According to this and other answers, this can be achieved by editing /etc/profile. However the comments at ...
Yarin's user avatar
  • 1,366
1 vote
1 answer
343 views

Proper way to set default permissions

I have Debian Squeeze server with set of users. All users must be able to work with shared files. So what I did is to set to all of these users same main group (e.g. editors) Then put files into /...
Alexey Kamenskiy's user avatar
1 vote
2 answers
473 views

umask seems to vary by user

I've got a development Ubuntu system for which I have several users: myself (with full sudo) and about 5 other users. (I've set up the system so everything in this respect is still at its default ...
paullb's user avatar
  • 185
0 votes
1 answer
1k views

create folder and files under User ownership in CakePHP

When CakePHP create a new Folder or File, its always owned by nobody and is set to 0755 or 0644 and for so i cant run php in SuPHP mode under the cPanel server to fix this i always run a Cron which ...
user avatar
0 votes
1 answer
840 views

umask in RHEL 6

How can one set the executable bit on files using umask? According to documentation, a umask of 000 should work, but in practice this only works on directories. Also open to other methods of ...
SeanFromIT's user avatar
3 votes
1 answer
6k views

NFSv3 + ACL: mask is gone on clients

I'm sharing a NFS folder among a user group. The default umask on the clients is 0700, and this is a problem because newly created files won't be readable/writable by another users. So, I'm using ...
Jorge Suárez de Lis's user avatar
-2 votes
2 answers
2k views

Chmod wont stick [closed]

I'm using CentOS on a virtual dedicated server. When I go in as root, and change the chmod value of a folder it works. But, any files I place into that folder do not inherit the chmod I set. This is ...
please delete me's user avatar
1 vote
1 answer
4k views

What is the best place to put umask setting for php-fpm in Centos 6?

For the following two places of php-fpm init configuration on Centos 6, which one do you think is the most suitable to put in, for example, umask = 077 ? /etc/init.d/php-fpm OR /etc/sysconfig/php-...
tonytz's user avatar
  • 153
0 votes
1 answer
908 views

umask is being ignored on Gentoo while creating new files

I have a server running Gentoo and hosting a drupal installation. Whenever a Drupal update is executed, the directory permissions of the updated module turn from 755 to 744 preventing the application ...
drcelus's user avatar
  • 1,254
14 votes
3 answers
39k views

How do I set default umask in Apache on Debian?

I need files created by apache2 to have umask 002, i.e. group rw, by default. I've tried putting umask 002 in /etc/apache2/envvars and although this script does get executed as part of apache start ...
artfulrobot's user avatar
  • 3,099
2 votes
1 answer
4k views

How to set default group permission in Ubuntu for www-data (apache's user)?

I have not been able to set a umask for www-data (apache's user). I tried to put umask 002, like in many other examples I found, in /etc/init.d/apache2 script, or in /etc/apache2/envvars.... Then I ...
arod's user avatar
  • 602