A few weeks ago I posted a message about umasks. I finally have a grasp on what it is and how it works. Something that I noticed (at least on my system) is when a user logs into the machine their umask is set to 022. How do I change this so that when any user logs into the system their umask is 002? I checked the /etc/bash.bashrc file and it really didn't help me out. I know how FC3 works but not too sure about SuSE. Thanks for any help. jay
Jay Paulson wrote:
A few weeks ago I posted a message about umasks. I finally have a grasp on what it is and how it works. Something that I noticed (at least on my system) is when a user logs into the machine their umask is set to 022. How do I change this so that when any user logs into the system their umask is 002? I checked the /etc/bash.bashrc file and it really didn't help me out. I know how FC3 works but not too sure about SuSE.
Add the command umask 002 to /etc/profile.local if you want it globally (/etc/profile can get overwritten at times, so it is best not to make the change there). Make the change in ~/.profile if you want it only on a per-user basis.
A few weeks ago I posted a message about umasks. I finally have a grasp on what it is and how it works. Something that I noticed (at least on my system) is when a user logs into the machine their umask is set to 022. How do I change this so that when any user logs into the system their umask is 002? I checked the /etc/bash.bashrc file and it really didn't help me out. I know how FC3 works but not too sure about SuSE.
Add the command
umask 002
to /etc/profile.local if you want it globally (/etc/profile can get overwritten at times, so it is best not to make the change there). Make the change in ~/.profile if you want it only on a per-user basis.
I guess that will have to do. I was hoping there was some script that would set it per user and would act globally. Kind of like how FC3 does it. Thanks for the help.
On Tuesday 06 September 2005 4:35 pm, Jay Paulson wrote:
I guess that will have to do. I was hoping there was some script that would set it per user and would act globally. Kind of like how FC3 does it. Are you referring to the skeleton files when a user is created? -- Jerry Feldman <gerald.feldman@hp.com> Linux Expertise Center (PTAC-MA/TX) Hewlett-Packard Co. 550 King Street LKG2a-X2 Littleton, Ma. 01460 (978)506-5243
I guess that will have to do. I was hoping there was some script that would set it per user and would act globally. Kind of like how FC3 does it. Are you referring to the skeleton files when a user is created?
Well FC3 does it with the /etc/bashrc file. It just looks to see if the user logging in has the same default usergroup as their username. If so set the umask to 002 otherwise set it to 022. It does this for every user when logging in. However, the why SuSE's users and how they are put in the default group users doesn't make this work. Therefore, I was looking at how I can do this in SuSE like FC3 does it. I guess I could edit the /etc/profile file and write a small script that said if the user is in the users group then set the umask to 002. Though I think this would probably cause more problems especially if the file gets over written like another said in this thread. Hope this helps explain what I am trying to do. Thanks, jay
On Tuesday 06 September 2005 5:03 pm, Jay Paulson wrote:
I guess that will have to do. I was hoping there was some script that would set it per user and would act globally. Kind of like how FC3 does it.
Are you referring to the skeleton files when a user is created?
Well FC3 does it with the /etc/bashrc file. It just looks to see if the user logging in has the same default usergroup as their username. If so set the umask to 002 otherwise set it to 022. It does this for every user when logging in. However, the why SuSE's users and how they are put in the default group users doesn't make this work. Therefore, I was looking at how I can do this in SuSE like FC3 does it. I guess I could edit the /etc/profile file and write a small script that said if the user is in the users group then set the umask to 002. Though I think this would probably cause more problems especially if the file gets over written like another said in this thread. You should not edit /etc/profile or /etc/bash.bashrc You do not need to set a script. You can do virtually the same thing in SuSE as you did in FC3. The main difference is whether to put it into /etc/profile.local or /etc/bash.bashrc.local.
-- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
Well FC3 does it with the /etc/bashrc file. It just looks to see if the user logging in has the same default usergroup as their username. If so set the umask to 002 otherwise set it to 022. It does this for every user when logging in. However, the why SuSE's users and how they are put in the default group users doesn't make this work. Therefore, I was looking at how I can do this in SuSE like FC3 does it. I guess I could edit the /etc/profile file and write a small script that said if the user is in the users group then set the umask to 002. Though I think this would probably cause more problems especially if the file gets over written like another said in this thread. You should not edit /etc/profile or /etc/bash.bashrc You do not need to set a script. You can do virtually the same thing in SuSE as you did in FC3. The main difference is whether to put it into /etc/profile.local or /etc/bash.bashrc.local.
Very cool! :) I noticed that my system doesn't have either /etc/profile.local or /etc/bash.bashrc.local. Do I just create one or both of those file and it should work? jay
Jay Paulson wrote:
Well FC3 does it with the /etc/bashrc file. It just looks to see if the user logging in has the same default usergroup as their username. If so set the umask to 002 otherwise set it to 022. It does this for every user when logging in. However, the why SuSE's users and how they are put in the default group users doesn't make this work. Therefore, I was looking at how I can do this in SuSE like FC3 does it. I guess I could edit the /etc/profile file and write a small script that said if the user is in the users group then set the umask to 002. Though I think this would probably cause more problems especially if the file gets over written like another said in this thread. You should not edit /etc/profile or /etc/bash.bashrc You do not need to set a script. You can do virtually the same thing in SuSE as you did in FC3. The main difference is whether to put it into /etc/profile.local or /etc/bash.bashrc.local.
Very cool! :) I noticed that my system doesn't have either /etc/profile.local or /etc/bash.bashrc.local. Do I just create one or both of those file and it should work?
Precisely. If you want to set umask 002 only for a specific group of users, then you can also very easily create a special group just for that purpose (and any other purposes you might need) -- then instead of setting umask 002 for all, you can test for those belonging to the special group, and set it only for them -- all done in /etc/profile, where I definitely prefer to place it (a user's umask is, after all, part of his user profile). However, put it in bashrc.local if you want it there. If you need any help with the scripting, you can probably take a page right out of FC3's script. The only difference between what you had there and what you will have in SuSE is that with SuSE you will have learned a bit how to do things for yourself, instead of having it spoonfed to you out of the box.
On Tuesay, September 06, 2005 @ 1:26 PM, Jay Paulson wrote:
Well FC3 does it with the /etc/bashrc file. It just looks to see if the user logging in has the same default usergroup as their username. If so set the umask to 002 otherwise set it to 022. It does this for every user when logging in. However, the why SuSE's users and how they are put in the default group users doesn't make this work. Therefore, I was looking at how I can do this in SuSE like FC3 does it. I guess I could edit the /etc/profile file and write a small script that said if the user is in the users group then set the umask to 002. Though I think this would probably cause more problems especially if the file gets over written like another said in this thread. You should not edit /etc/profile or /etc/bash.bashrc You do not need to set a script. You can do virtually the same thing in SuSE as you did in FC3. The main difference is whether to put it into /etc/profile.local or /etc/bash.bashrc.local.
Very cool! :) I noticed that my system doesn't have either /etc/profile.local or /etc/bash.bashrc.local. Do I just create one or both of those file and it should work?
jay
Yes Greg Wallace
On Tuesay, September 06, 2005 @ 1:03 PM, Jay Paulson wrote:
I guess that will have to do. I was hoping there was some script that would set it per user and would act globally. Kind of like how FC3 does it. Are you referring to the skeleton files when a user is created?
Well FC3 does it with the /etc/bashrc file. It just looks to see if the user logging in has the same default usergroup as their username. If so set the umask to 002 otherwise set it to 022. It does this for every user when logging in. However, the why SuSE's users and how they are put in the default group users doesn't make this work. Therefore, I was looking at how I can do this in SuSE like FC3 does it. I guess I could edit the /etc/profile file and write a small script that said if the user is in the users group then set the umask to 002. Though I think this would probably cause more problems especially if the file gets over written like another said in this thread.
Hope this helps explain what I am trying to do.
Thanks, jay
Use /etc/profile.local instead. /etc/profile is subject to being updated at any time by SuSE. /etc/profile.local will not be changed by SuSE. Greg Wallace
Darryl Gregorash wrote:
Jay Paulson wrote:
A few weeks ago I posted a message about umasks. I finally have a grasp on what it is and how it works. Something that I noticed (at least on my system) is when a user logs into the machine their umask is set to 022. How do I change this so that when any user logs into the system their umask is 002? I checked the /etc/bash.bashrc file and it really didn't help me out. I know how FC3 works but not too sure about SuSE.
Add the command
umask 002
to /etc/profile.local if you want it globally (/etc/profile can get overwritten at times, so it is best not to make the change there). Make the change in ~/.profile if you want it only on a per-user basis.
For global changes, use /etc/profile.local, which is run near the end of /etc/profile.
On Tuesday 06 September 2005 4:23 pm, Jay Paulson wrote:
A few weeks ago I posted a message about umasks. I finally have a grasp on what it is and how it works. Something that I noticed (at least on my system) is when a user logs into the machine their umask is set to 022. How do I change this so that when any user logs into the system their umask is 002? I checked the /etc/bash.bashrc file and it really didn't help me out. I know how FC3 works but not too sure about SuSE. Note that umask 022 is set in /etc/profile You should be able to create /etc/profile.local and add 'umask 002' to it.
-- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
Jay Paulson wrote:
A few weeks ago I posted a message about umasks. I finally have a grasp on what it is and how it works. Something that I noticed (at least on my system) is when a user logs into the machine their umask is set to 022. How do I change this so that when any user logs into the system their umask is 002? I checked the /etc/bash.bashrc file and it really didn't help me out. I know how FC3 works but not too sure about SuSE.
The default umask is set in /etc/profile. However, if you want to change anything, you're supposed to do that in /etc/profile.local.
participants (6)
-
Darryl Gregorash
-
Greg Wallace
-
James Knott
-
Jay Paulson
-
Jerry Feldman
-
Jerry Feldman