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 06-19-2012, 04:34 AM   #1
yankwizera
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Rep: Reputation: Disabled
Permissions on Folders


Hello, I created a user "user1" and restricted the folder he can access using rbash but at the same time I want him to be able to upload files in that folder but that folder is also used by apache web server,
How can I do that without removing apache from the users? using chown or chmod?a practical example?

Thank you
 
Old 06-19-2012, 06:19 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Permissions on a file or directory are organized in 3 categories: Owner, group, and other. In each category, there are three types of permission: read, write, and execute. For a file, execute is used only when the file is some kind of executable code--including scripts. For directories, the execute permission also controls whether one is allowed to create new files or directories.

If. for example, you want to grant privileges based on group membership, then it does not matter who else is in that group----all members of the group will have the same privileges (controlled by what is in the "group" field in the file or directory permissions.


The use of "rbash" appears act as a layer on top of these basics--I'm not familiar with the details, but Google finds lots of information
 
1 members found this post helpful.
Old 06-19-2012, 10:12 AM   #3
yankwizera
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
thank you very much Pixellany, as The person said: "it is something", am going to google it
 
Old 06-19-2012, 07:15 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,294

Rep: Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358Reputation: 2358
Quote:
For directories, the execute permission also controls whether one is allowed to create new files or directories.
I always believed the x perm on a dir is to enable you to traverse it using wildcards (search bit) ; without you can only list known filenames eg http://stackoverflow.com/questions/7...ions-reasoning if 'r' is set on in both cases.

I'm pretty sure 'w' is what allows you to create a file in that dir; its a write op on the dir file.
 
Old 06-20-2012, 02:02 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by yankwizera View Post
Hello, I created a user "user1" and restricted the folder he can access using rbash but at the same time I want him to be able to upload files in that folder but that folder is also used by apache web server,
How can I do that without removing apache from the users? using chown or chmod?a practical example?

Thank you
There are other ways as well to do the same

I think you should surf a bit about "setfacl"
 
Old 06-20-2012, 03:47 AM   #6
yankwizera
LQ Newbie
 
Registered: Jun 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Yeah, indeed I run into it and saw that it can do a lot, thank you so much
 
Old 06-20-2012, 12:02 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by chrism01 View Post
I'm pretty sure 'w' is what allows you to create a file in that dir; its a write op on the dir file.
You need both x and w:
Code:
[mherring@herring-lap play]$ mkdir test
[mherring@herring-lap play]$ chmod test -x -w
[mherring@herring-lap play]$ ls -l|grep test
dr--r--r-- 2 mherring users 4096 Jun 20 12:59 test
[mherring@herring-lap play]$ touch test/newfile
touch: cannot touch ‘test/newfile’: Permission denied
[mherring@herring-lap play]$ chmod +w test
[mherring@herring-lap play]$ touch test/newfile
touch: cannot touch ‘test/newfile’: Permission denied
[mherring@herring-lap play]$ chmod +x test
[mherring@herring-lap play]$ touch test/newfile
[mherring@herring-lap play]$ ls test
newfile
 
  


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
Permissions on /etc and other folders Brandon.Wamboldt Linux - Server 3 05-04-2009 06:51 PM
change permissions of all folders and sub folders cad Linux - General 3 01-28-2007 10:21 AM
permissions of files and folders binary_dreamer Linux - General 2 04-05-2006 11:13 PM
Permissions for folders geolew Red Hat 4 09-03-2003 09:49 PM
Permissions with windoze folders sportjeep99 Linux - General 1 06-07-2001 10:07 PM


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