Ubuntu Linux set default folder permissions for specific directory?

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.
How can I make the default permissions for a directory created by the user www-data in /data/ 774?
The folder owner is www-data and the user group is www-data.
I've tried doing the following:
sudo setfacl -dR -m g::rwx,u::rwx /data/
sudo chmod -R 774 /dataCould it be umask related?
My
getfacloutput is as follows:getfacl: Removing leading '/' from absolute path names
# file: data/
# owner: www-data
# group: www-data
# flags: -s-
user::rwx
user:www-data:rwx
user:ubuntu:rwx
group::rwx
mask::rwx
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx
How can I achieve this?
ubuntu permissions webserver
add a comment |Â
up vote
0
down vote
favorite
My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.
How can I make the default permissions for a directory created by the user www-data in /data/ 774?
The folder owner is www-data and the user group is www-data.
I've tried doing the following:
sudo setfacl -dR -m g::rwx,u::rwx /data/
sudo chmod -R 774 /dataCould it be umask related?
My
getfacloutput is as follows:getfacl: Removing leading '/' from absolute path names
# file: data/
# owner: www-data
# group: www-data
# flags: -s-
user::rwx
user:www-data:rwx
user:ubuntu:rwx
group::rwx
mask::rwx
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx
How can I achieve this?
ubuntu permissions webserver
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.
How can I make the default permissions for a directory created by the user www-data in /data/ 774?
The folder owner is www-data and the user group is www-data.
I've tried doing the following:
sudo setfacl -dR -m g::rwx,u::rwx /data/
sudo chmod -R 774 /dataCould it be umask related?
My
getfacloutput is as follows:getfacl: Removing leading '/' from absolute path names
# file: data/
# owner: www-data
# group: www-data
# flags: -s-
user::rwx
user:www-data:rwx
user:ubuntu:rwx
group::rwx
mask::rwx
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx
How can I achieve this?
ubuntu permissions webserver
My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.
How can I make the default permissions for a directory created by the user www-data in /data/ 774?
The folder owner is www-data and the user group is www-data.
I've tried doing the following:
sudo setfacl -dR -m g::rwx,u::rwx /data/
sudo chmod -R 774 /dataCould it be umask related?
My
getfacloutput is as follows:getfacl: Removing leading '/' from absolute path names
# file: data/
# owner: www-data
# group: www-data
# flags: -s-
user::rwx
user:www-data:rwx
user:ubuntu:rwx
group::rwx
mask::rwx
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx
How can I achieve this?
ubuntu permissions webserver
edited Feb 19 at 9:28
aliceinpalth
760116
760116
asked Feb 19 at 5:48
Asma.Said
1
1
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.
umask 003
www-data needs to set that before creating files or directories.
how would you set umask for specific user "www-data" per directory ? Thanks
â Asma.Said
Feb 19 at 9:45
It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
â Gerard H. Pille
Feb 19 at 9:56
yes it's Apache httpd, and it's using mkdir
â Asma.Said
Feb 19 at 10:47
I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
â Gerard H. Pille
Feb 19 at 14:16
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.
umask 003
www-data needs to set that before creating files or directories.
how would you set umask for specific user "www-data" per directory ? Thanks
â Asma.Said
Feb 19 at 9:45
It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
â Gerard H. Pille
Feb 19 at 9:56
yes it's Apache httpd, and it's using mkdir
â Asma.Said
Feb 19 at 10:47
I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
â Gerard H. Pille
Feb 19 at 14:16
add a comment |Â
up vote
0
down vote
My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.
umask 003
www-data needs to set that before creating files or directories.
how would you set umask for specific user "www-data" per directory ? Thanks
â Asma.Said
Feb 19 at 9:45
It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
â Gerard H. Pille
Feb 19 at 9:56
yes it's Apache httpd, and it's using mkdir
â Asma.Said
Feb 19 at 10:47
I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
â Gerard H. Pille
Feb 19 at 14:16
add a comment |Â
up vote
0
down vote
up vote
0
down vote
My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.
umask 003
www-data needs to set that before creating files or directories.
My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.
umask 003
www-data needs to set that before creating files or directories.
answered Feb 19 at 8:41
Gerard H. Pille
1,169212
1,169212
how would you set umask for specific user "www-data" per directory ? Thanks
â Asma.Said
Feb 19 at 9:45
It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
â Gerard H. Pille
Feb 19 at 9:56
yes it's Apache httpd, and it's using mkdir
â Asma.Said
Feb 19 at 10:47
I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
â Gerard H. Pille
Feb 19 at 14:16
add a comment |Â
how would you set umask for specific user "www-data" per directory ? Thanks
â Asma.Said
Feb 19 at 9:45
It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
â Gerard H. Pille
Feb 19 at 9:56
yes it's Apache httpd, and it's using mkdir
â Asma.Said
Feb 19 at 10:47
I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
â Gerard H. Pille
Feb 19 at 14:16
how would you set umask for specific user "www-data" per directory ? Thanks
â Asma.Said
Feb 19 at 9:45
how would you set umask for specific user "www-data" per directory ? Thanks
â Asma.Said
Feb 19 at 9:45
It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
â Gerard H. Pille
Feb 19 at 9:56
It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
â Gerard H. Pille
Feb 19 at 9:56
yes it's Apache httpd, and it's using mkdir
â Asma.Said
Feb 19 at 10:47
yes it's Apache httpd, and it's using mkdir
â Asma.Said
Feb 19 at 10:47
I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
â Gerard H. Pille
Feb 19 at 14:16
I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
â Gerard H. Pille
Feb 19 at 14:16
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f425088%2fubuntu-linux-set-default-folder-permissions-for-specific-directory%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password