LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-28-2004, 10:38 AM   #1
Cort
LQ Newbie
 
Registered: Sep 2004
Location: Missouri
Distribution: Red Hat Enterprise 9.0
Posts: 11

Rep: Reputation: 0
umask setting


What file sets the default umask for a particular directory, so that when the file is created it will set it to "755"?

I am using RH version 9.

An example would be: a file created named "CAC1201.DAT" that is under the directory of "/home/janus/jadm/cac".

Currently when created it is set to "600". I want it to be "755" when created.
 
Old 09-28-2004, 11:40 AM   #2
dsegel
Member
 
Registered: Aug 2004
Location: Davis, California
Distribution: Gentoo, always Gentoo.
Posts: 159

Rep: Reputation: 30
The umask setting is typically set on a per-shell basis. To change the umask for everyone put it in /etc/profile. For an individual user put in ~/.bash_profile.

If you want default directory permissons to be 755 then the umask needs to be 022. The umask is the permission you want subtracted from 777. In this example 777 - 755 = 022.

The umask only applies to newly created files; if you need to change the permissions on an existing file use the 'chmod' command.

There is no automated method of making the umask different for different directories. It's the same value everywhere, but you could set up a cron script to change the permissions on some or all the files in a given directory within a minute of when they are created.

Last edited by dsegel; 09-28-2004 at 11:42 AM.
 
Old 09-28-2004, 12:18 PM   #3
Cort
LQ Newbie
 
Registered: Sep 2004
Location: Missouri
Distribution: Red Hat Enterprise 9.0
Posts: 11

Original Poster
Rep: Reputation: 0
Thank You!

I was considering using cron, but wanted to see if there was somewhere else to accomplish what I wanted.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nfs umask setting mvo Linux - Newbie 1 09-16-2005 09:52 PM
setting root's umask triley Linux - Security 3 08-05-2005 08:56 AM
umask setting?? TheRealDeal Linux - General 4 01-03-2004 02:45 AM
umask setting on ftp server fuzzyboots Linux - Newbie 1 07-18-2003 04:13 AM
setting umask that affects all programs in X...? apeekaboo Linux - Security 7 06-12-2003 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration