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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-19-2012, 04:34 AM
|
#1
|
LQ Newbie
Registered: Jun 2012
Posts: 3
Rep:
|
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
|
|
|
06-19-2012, 06:19 AM
|
#2
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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.
|
06-19-2012, 10:12 AM
|
#3
|
LQ Newbie
Registered: Jun 2012
Posts: 3
Original Poster
Rep:
|
thank you very much Pixellany, as The person said: "it is something", am going to google it
|
|
|
06-19-2012, 07:15 PM
|
#4
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397
|
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.
|
|
|
06-20-2012, 02:02 AM
|
#5
|
Senior Member
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
|
Quote:
Originally Posted by yankwizera
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"
|
|
|
06-20-2012, 03:47 AM
|
#6
|
LQ Newbie
Registered: Jun 2012
Posts: 3
Original Poster
Rep:
|
Yeah, indeed I run into it and saw that it can do a lot, thank you so much
|
|
|
06-20-2012, 12:02 PM
|
#7
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
Quote:
Originally Posted by chrism01
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
|
|
|
All times are GMT -5. The time now is 01:10 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|