LinuxQuestions.org
Review your favorite Linux distribution.
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 01-18-2010, 01:33 AM   #1
masatheesh
Member
 
Registered: Aug 2007
Distribution: CentOS 5.0,CentOS 5.5
Posts: 47

Rep: Reputation: 15
Cant create directory


Hi,

I set security context for a folder as 702 to enable other users to create and delete folder contents.But whenever other users try to create a folder,its says "Permission denied".Can anyone please tell me the reason?
 
Old 01-18-2010, 01:44 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
If you really want everyone to be able to write there you should also let them read (so they can see what file are there) and also execute so they can cd there. If this is what you want then, set it to 777.

Regarding the specifics of your question it may be because those users are in the group that owns the directory, but you have set it to not be group writable.

Evo2.
 
Old 01-18-2010, 01:53 AM   #3
masatheesh
Member
 
Registered: Aug 2007
Distribution: CentOS 5.0,CentOS 5.5
Posts: 47

Original Poster
Rep: Reputation: 15
Despite I need only write into that folder,Should I give read and execute permission also?
 
Old 01-18-2010, 01:59 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by masatheesh View Post
Despite I need only write into that folder,Should I give read and execute permission also?
It's up to you but if you don't, people won't be able to do an ls (requires read) of cd to the dir (requires execute).

Did you confirm if the writing problem was because of the group?

Evo2.
 
Old 01-18-2010, 02:36 AM   #5
masatheesh
Member
 
Registered: Aug 2007
Distribution: CentOS 5.0,CentOS 5.5
Posts: 47

Original Poster
Rep: Reputation: 15
Thanks for your replies.


Yes, I have checked with group permission.This folder is not folder level security context.I want to give write permission only to all users.All users dont want to do ls and cd to this directory.
 
Old 01-18-2010, 02:51 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by masatheesh View Post
Yes, I have checked with group permission.
Um, so what was the outcome?

Quote:
This folder is not folder level security context.I want to give write permission only to all users.All users dont want to do ls and cd to this directory.
Ok, well assuming that the group was the problem (but I don't know because you haven't said), then permissions 722 should do what you want.

Evo2.

Last edited by evo2; 01-18-2010 at 04:14 AM. Reason: typo
 
Old 01-18-2010, 03:41 AM   #7
masatheesh
Member
 
Registered: Aug 2007
Distribution: CentOS 5.0,CentOS 5.5
Posts: 47

Original Poster
Rep: Reputation: 15
output is "mkdir: cannot create directory : Permission denied".I want to set the permission as 702.
 
Old 01-18-2010, 04:13 AM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by masatheesh View Post
output is "mkdir: cannot create directory : Permission denied".I want to set the permission as 702.
That in no way constitutes checking the group permissions.

That would be done with:

Code:
ls -ld /path/to/public/directory
group username
where "username" is the name of a user who can't write to that directory.

Evo2.
 
Old 01-18-2010, 04:30 AM   #9
masatheesh
Member
 
Registered: Aug 2007
Distribution: CentOS 5.0,CentOS 5.5
Posts: 47

Original Poster
Rep: Reputation: 15
This is the output

drwx---rw- 3 root root 4096 Jan 18 12:34 Test/

check: users
 
Old 01-18-2010, 04:58 AM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Ok, seems not to be related to groups.

What happens if you make the directory executable (eg chmod 707 of 777), like I originally suggested?

Evo2.
 
Old 01-18-2010, 05:36 AM   #11
masatheesh
Member
 
Registered: Aug 2007
Distribution: CentOS 5.0,CentOS 5.5
Posts: 47

Original Poster
Rep: Reputation: 15
If I set it as 707 or 703,It allows to create folder.But my doubt is,why execute permission is required even only write?
 
Old 01-18-2010, 05:53 AM   #12
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
I know that execute permissions are required to enter the directory, I guess it seems logical that to write to a directory, on some level you would need to enter it. I'm sure a proper answer could be found somewhere in some unix documentation.

Good luck,

Evo2.
 
  


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
create a directory in C++ poeta_boy Programming 15 11-02-2011 02:53 PM
mkdir : cannot create directory : no such file or directory patcheezy Linux - Newbie 6 05-13-2009 12:26 PM
can't create new directory dummoi Linux - Newbie 4 06-24-2004 03:50 PM
Can't create new directory!!?? catty Linux - Newbie 7 10-06-2003 06:33 PM
Create a directory SnowSurfAir Linux - Software 15 07-21-2003 07:12 PM

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

All times are GMT -5. The time now is 09:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration