Changing umask value

The name of the pictureThe name of the pictureThe name of the pictureClash 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 .







share|improve this question
























    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 .







    share|improve this question






















      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 .







      share|improve this question












      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 .









      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 5 '17 at 6:29









      Zama Ques

      87272441




      87272441




















          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.






          share|improve this answer




















          • 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










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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.






          share|improve this answer




















          • 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














          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.






          share|improve this answer




















          • 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












          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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 as umask 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










          • @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















          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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay