LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-15-2015, 10:04 PM   #1
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Rep: Reputation: Disabled
Permission for Directories


Hi Guys,

I have given permission chmod -R 777 /abc/xyz. This Path is public so every one can create and delete the files. I am not able give inherent permission to this path. Say user1 created directory under /abc/xyz/doc only user1 can have full permission but group and others getting read and execute permissions. I have to give full permission to all users no matter who creates directory. Suppose user2 create directory under /abc/xyz/fin-doc. It should create with full permissions. Please advice your tips.

Thanks,
Asteroid Meteor
 
Old 06-16-2015, 01:33 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
The thing you are asking would let a user delete the directories/files of other users.

Anyway it is done by setting 'umask' to value which lets this.

Code:
umask 7000
And you set the umask before the user creates a file/directory. You have to make/ensure that a user gets this value.
 
Old 06-16-2015, 02:38 AM   #3
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
Hi Veerain,

When i enable umask to 7000 it would be effect to all other directories also . I want to set it only under /abc/xyz directories only. Rest all directories should remain default umask value. Is it possible ?
 
Old 06-16-2015, 04:02 AM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
For such a specific requirement, I might create a small shell script say _md_ to do mkdir followed by chmod thus:

if $# -eq 1 then proceed else give usage message and quit
mkdir /abc/xyx/$1
chmod +777 /abc/xyz/$1
quit

I might place it in /etc/profile so that it can be used by ALL logins.

OK
PS: This is pseudo code and so I didn't use the code tag.
 
Old 06-16-2015, 04:50 AM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can setup a special session for your users in which only this umask value is set.
 
Old 06-16-2015, 10:18 PM   #6
asteroid4u
Member
 
Registered: Jun 2015
Posts: 58

Original Poster
Rep: Reputation: Disabled
I am sharing above file systems using samba share so windows users are going access. Please help
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
command to view permission of directories babu198649 Linux - Newbie 9 10-27-2007 07:56 AM
User directories permission problem The_eXXe Linux - Server 8 07-26-2007 12:27 PM
permission on user directories changing zpidr Linux - Security 5 06-13-2006 10:22 AM
shat should it be/best permission for ... directories eeyoree Linux - Security 2 01-10-2005 09:34 AM
Damn permission on LAN directories pacut Linux - Newbie 4 01-15-2004 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:28 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