0

I have created a system account that's used by some process specifically. I want to set umask 002 for it. For regular user account, I usually put configuration like this in .profile. This approach is not suitable for system account, as .profile is sourced at login and system account doesn't require login.

Where can I set umask 002 for system account?

tamakisquare
  • 16,659
  • 26
  • 88
  • 129

2 Answers2

0

On most Linux systems, it is usually set in /etc/profile, but it can also be set in /etc/bashrc.

The latter gets sourced for all bash script invocations, not just logins.

However, if the system process is not started from a bash script, then you'll need to use a PAM configuration.

aks
  • 2,328
  • 1
  • 16
  • 15
0

edit /etc/profile and try this:

if [ `id -u` -eq $user_id_to _change ]; then
   umask 002
else
   umask 022
fi

of course you have to change $user_id_to_change to the user id of which you want to change the umask. than reboot. this code snippet defenitly works with "normal" users. cant imagine, why this shouldnt work with system users.

thebackfisch
  • 21
  • 1
  • 2