On Fri, 2003-06-20 at 09:31, Jianping Zhu wrote: > On Thu, Jun 19, 2003 at 07:53:23PM -0500, Bret Hughes wrote: > > On Thu, 2003-06-19 at 14:47, Robert P. J. Day wrote: > > > On Thu, 19 Jun 2003, Bret Hughes wrote: > > > > > > > On Thu, 2003-06-19 at 11:04, Jianping Zhu wrote: > > > > > I have a redhat 7.1 box server, now the the defautl umask for every user > > > > > is 022, how can I change it to 002? > > > > > Thanks > > > > > > > > > > > > > As root edit /etc/bashrc. There should be code in there to set the > > > > umask. > > > > > > > > This has most likely been changed from the original install and I guess > > > > could have been changed in the /etc/skel/.bashrc instead. > > > > > > if you want to change some user-wide property, you might want to > > > avoid actually editing /etc system files. while this will work, > > > any changes you make to files like /etc/profile or /etc/bashrc > > > will be lost if you upgrade and the upgrade installs a new > > > copy of that file. > > > > > > you're better off adding extra files to the directory > > > /etc/profile.d, which are sourced automatically from the bottom > > > of /etc/profile. that way, you can keep all your changes in > > > the same place, and it's much easier after an upgrade to just > > > restore your extra files to that directory. > > > > > > > Very good point. I usually work really hard to keep changes upgrade > > safe and will add this to my tool box. Thanks. > > > > > > Bret > > > > > > Thank, Bret. > Can you give me an example how the extra file looks like. > i want root has umask 022 and regular usr have u mask 002. > Thank you again! >
probably something like this would work put the following text into a file called /etc/profile.d/mask.sh if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then # for bash, pdksh and zsh, set the umask umask 0002 fi IIUC each of the .sh files will be sourced at login. This really should already be there. Try grep umask /etc/* and see if you can tell where the change was made and undo it. The default really is to have 0002 perms for not root users. you could also try verifying the setup and file utils packages to see if on of the stadard config files have been changed on my machine (7.3) [EMAIL PROTECTED] profile.d]$ rpm -qf . fileutils-4.1-10 setup-2.5.12-1 [EMAIL PROTECTED] profile.d]$ rpm -V fileutils setup S.5....T c /etc/printcap ..?..... c /etc/securetty [EMAIL PROTECTED] profile.d]$ rpm -qf /etc/bashrc setup-2.5.12-1 -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list