LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Umask change. (https://www.linuxquestions.org/questions/linux-newbie-8/umask-change-884941/)

pinga123 06-07-2011 02:27 AM

Umask change.
 
I have logged in with root user
My systems Umask value was 0022.
Code:

#umask
0022

So i decided to change it to 0077 and observe the system for some time.
so i edited /etc/profile
and added

Code:

umask 077
at the end of file

rebooted the machine.

But the umask is still showing as 0022

After the first attempt is failed I tried changing it using
below command.

Code:

#umask 077
Validated it.
Code:

# umask
0077

rebooted the machine
but the umask is still showing 0022

So at last i have to modify /etc/bashrc file and add umask 077 at the end of the file.

How would i make it in general for all(Even for non-root user) and not just for bash prompt.

What could be the issue?

divyashree 06-07-2011 03:39 AM

Changes in /etc/profile will affect the new users to be created. For the created users you have to manually edit their .bashrc file in their home directory.

ssrameez 06-07-2011 03:43 AM

You can make change in /etc/bashrc

pinga123 06-07-2011 04:46 AM

Quote:

Originally Posted by ssrameez (Post 4378576)
You can make change in /etc/bashrc

but this will only make it specific to bash .
How would i make it in general.

vikas027 06-07-2011 07:41 AM

I feel for this you need to edit /etc/profile and add "umask 077" which you have already done.
Also, make sure your /etc/bashrc does not have any "umask" entry.

Could you please paste outputs of below commands.
Code:

grep -v ^# umask /etc/profile
grep -v ^# umask /etc/bashrc



All times are GMT -5. The time now is 09:19 PM.