Changing umask value
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
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
else
umask 022
fi
If I change /etc/profile
, it will impact all users but I want to change the setting for jboss
user only. For this I can edit .basrhrc/.bash_profile
under user's home directory . But the issue for me is that the user does not have a shell . Any way to set umask
for users without shell .
permissions chmod umask
add a comment |Â
up vote
0
down vote
favorite
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
else
umask 022
fi
If I change /etc/profile
, it will impact all users but I want to change the setting for jboss
user only. For this I can edit .basrhrc/.bash_profile
under user's home directory . But the issue for me is that the user does not have a shell . Any way to set umask
for users without shell .
permissions chmod umask
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
else
umask 022
fi
If I change /etc/profile
, it will impact all users but I want to change the setting for jboss
user only. For this I can edit .basrhrc/.bash_profile
under user's home directory . But the issue for me is that the user does not have a shell . Any way to set umask
for users without shell .
permissions chmod umask
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
else
umask 022
fi
If I change /etc/profile
, it will impact all users but I want to change the setting for jboss
user only. For this I can edit .basrhrc/.bash_profile
under user's home directory . But the issue for me is that the user does not have a shell . Any way to set umask
for users without shell .
permissions chmod umask
asked Nov 5 '17 at 6:29
Zama Ques
87272441
87272441
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
The umask
is a property of a process, not a user.
It is inherited by children and preserved across execution of commands even setuid ones.
It is set with the umask()
system call. The shell interface to that umask()
system call is the umask
builtin command.
There is no magical way to have the umask be changed whenever a process changes uid, but some programs that are typically used to change uids can be configured to. That's the case of those using the PAM stack on Linux at least (typically login programs), using the pam_umask
module, or sudo
.
But here, given that that user doesn't have a shell, I suppose it's not one that logs in, and you actually want one particular software run as that user to have that umask. Then, that should be just a matter of starting that software with:
(umask 002; exec that-software)
In a shell script.
It is a java process for me with a Web interface. When we try to upload an image using this process of creates a new directory without write permission for group owner. We want to change the umask so that every new directory is created with write permission for group.
â Zama Ques
Nov 5 '17 at 8:23
@ZamaQues, yes, sounds like you just need to start that java command asumask 002; java ...
â Stéphane Chazelas
Nov 5 '17 at 8:56
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
The umask
is a property of a process, not a user.
It is inherited by children and preserved across execution of commands even setuid ones.
It is set with the umask()
system call. The shell interface to that umask()
system call is the umask
builtin command.
There is no magical way to have the umask be changed whenever a process changes uid, but some programs that are typically used to change uids can be configured to. That's the case of those using the PAM stack on Linux at least (typically login programs), using the pam_umask
module, or sudo
.
But here, given that that user doesn't have a shell, I suppose it's not one that logs in, and you actually want one particular software run as that user to have that umask. Then, that should be just a matter of starting that software with:
(umask 002; exec that-software)
In a shell script.
It is a java process for me with a Web interface. When we try to upload an image using this process of creates a new directory without write permission for group owner. We want to change the umask so that every new directory is created with write permission for group.
â Zama Ques
Nov 5 '17 at 8:23
@ZamaQues, yes, sounds like you just need to start that java command asumask 002; java ...
â Stéphane Chazelas
Nov 5 '17 at 8:56
add a comment |Â
up vote
3
down vote
The umask
is a property of a process, not a user.
It is inherited by children and preserved across execution of commands even setuid ones.
It is set with the umask()
system call. The shell interface to that umask()
system call is the umask
builtin command.
There is no magical way to have the umask be changed whenever a process changes uid, but some programs that are typically used to change uids can be configured to. That's the case of those using the PAM stack on Linux at least (typically login programs), using the pam_umask
module, or sudo
.
But here, given that that user doesn't have a shell, I suppose it's not one that logs in, and you actually want one particular software run as that user to have that umask. Then, that should be just a matter of starting that software with:
(umask 002; exec that-software)
In a shell script.
It is a java process for me with a Web interface. When we try to upload an image using this process of creates a new directory without write permission for group owner. We want to change the umask so that every new directory is created with write permission for group.
â Zama Ques
Nov 5 '17 at 8:23
@ZamaQues, yes, sounds like you just need to start that java command asumask 002; java ...
â Stéphane Chazelas
Nov 5 '17 at 8:56
add a comment |Â
up vote
3
down vote
up vote
3
down vote
The umask
is a property of a process, not a user.
It is inherited by children and preserved across execution of commands even setuid ones.
It is set with the umask()
system call. The shell interface to that umask()
system call is the umask
builtin command.
There is no magical way to have the umask be changed whenever a process changes uid, but some programs that are typically used to change uids can be configured to. That's the case of those using the PAM stack on Linux at least (typically login programs), using the pam_umask
module, or sudo
.
But here, given that that user doesn't have a shell, I suppose it's not one that logs in, and you actually want one particular software run as that user to have that umask. Then, that should be just a matter of starting that software with:
(umask 002; exec that-software)
In a shell script.
The umask
is a property of a process, not a user.
It is inherited by children and preserved across execution of commands even setuid ones.
It is set with the umask()
system call. The shell interface to that umask()
system call is the umask
builtin command.
There is no magical way to have the umask be changed whenever a process changes uid, but some programs that are typically used to change uids can be configured to. That's the case of those using the PAM stack on Linux at least (typically login programs), using the pam_umask
module, or sudo
.
But here, given that that user doesn't have a shell, I suppose it's not one that logs in, and you actually want one particular software run as that user to have that umask. Then, that should be just a matter of starting that software with:
(umask 002; exec that-software)
In a shell script.
answered Nov 5 '17 at 8:06
Stéphane Chazelas
283k53521854
283k53521854
It is a java process for me with a Web interface. When we try to upload an image using this process of creates a new directory without write permission for group owner. We want to change the umask so that every new directory is created with write permission for group.
â Zama Ques
Nov 5 '17 at 8:23
@ZamaQues, yes, sounds like you just need to start that java command asumask 002; java ...
â Stéphane Chazelas
Nov 5 '17 at 8:56
add a comment |Â
It is a java process for me with a Web interface. When we try to upload an image using this process of creates a new directory without write permission for group owner. We want to change the umask so that every new directory is created with write permission for group.
â Zama Ques
Nov 5 '17 at 8:23
@ZamaQues, yes, sounds like you just need to start that java command asumask 002; java ...
â Stéphane Chazelas
Nov 5 '17 at 8:56
It is a java process for me with a Web interface. When we try to upload an image using this process of creates a new directory without write permission for group owner. We want to change the umask so that every new directory is created with write permission for group.
â Zama Ques
Nov 5 '17 at 8:23
It is a java process for me with a Web interface. When we try to upload an image using this process of creates a new directory without write permission for group owner. We want to change the umask so that every new directory is created with write permission for group.
â Zama Ques
Nov 5 '17 at 8:23
@ZamaQues, yes, sounds like you just need to start that java command as
umask 002; java ...
â Stéphane Chazelas
Nov 5 '17 at 8:56
@ZamaQues, yes, sounds like you just need to start that java command as
umask 002; java ...
â Stéphane Chazelas
Nov 5 '17 at 8:56
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%2f402598%2fchanging-umask-value%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