LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-16-2007, 10:10 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Question MKDIR Permissions?


On my server I have a directory called /data and when I am logged in as root, I normally create a new directory in /data/.

My problem is right now as root in /data, when I mkdir <whatever>, the permissions are not what I want on the new directory. Is there a way to set up this server to apply specific permissions to a new directory?

Right now when I run the mkdir command, this is what I get by default:

Code:
drwxr-sr-x  2 root    admin 4096 May 16 10:45 drivers
Then I normally do the following to correct the permissions I don't like.

Code:
[root@fback data]# chmod -R 770 /data/
[root@fback data]# chmod -R g+s /data/
This now fixes the new directory and files under /data but is there a way I can avoid this and have all my newly created directories be 770 and throw a sticky bit on the group permission so when someone creates anything under that directory, the group will always be "admin"?
 
Old 05-16-2007, 10:54 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I think you can achieve this by setting global umask value.
 
Old 05-16-2007, 04:56 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Does "global" umask allow you to set it at a specific subdirectory or is it global for the / dir and everything under?
 
Old 05-16-2007, 09:28 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
The umask is global. I'm not aware of any way to make it apply to only one particular directory. You could always do

mkdir -m 2770 /data/whatever

to make the directory and set the permissions in one step.
 
Old 05-17-2007, 09:50 AM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
So how does one set the global umask if I want newly future directories to -drwxrwx--- or 770?
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mkdir -p ? shanenin Linux - Software 4 10-19-2011 11:41 AM
mkdir options sravanth.svk Linux - Newbie 4 10-26-2006 12:31 AM
mkdir recompilation puishor Programming 4 06-25-2005 04:37 PM
mkdir help... Linux~Powered Linux - Software 2 06-13-2004 11:27 AM
mkdir help ITJedi Linux - Software 1 05-14-2004 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:15 AM.

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