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 |
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-12-2013, 03:13 PM
|
#1
|
|
LQ Newbie
Registered: Jul 2009
Location: Morgan Hill, CA
Distribution: Ubuntu
Posts: 20
Rep:
|
Can't access folder I am in group of
I am just learning permissions and I'm running into a problem I can't figure out.
My goal is to have a group with write access to a folder where the owner does not have write access.
Code:
mkdir newfolder
chown lesseruser newfolder
chgrp greaterusers newfolder
chmod 570 newfolder
I have verified in /etc/group that my user is a member of greaterusers, but I can't access the folder.
|
|
|
|
01-12-2013, 04:08 PM
|
#2
|
|
Senior Member
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,624
|
The 'user' permissions get applied before the 'group' permissions - so if you're the user, then regardless of the group permissions, you get what the user permissions allow you to do (e.g. if you run
Code:
chown otheruser newfolder
then lesseruser should be able to write to the folder correctly)
Regards,
|
|
|
|
01-12-2013, 04:20 PM
|
#3
|
|
LQ Newbie
Registered: Jul 2009
Location: Morgan Hill, CA
Distribution: Ubuntu
Posts: 20
Original Poster
Rep:
|
That is not what I'm trying to do.
Last edited by I Use Dial; 01-12-2013 at 04:21 PM.
|
|
|
|
01-12-2013, 04:23 PM
|
#4
|
|
LQ Newbie
Registered: Jul 2009
Location: Morgan Hill, CA
Distribution: Ubuntu
Posts: 20
Original Poster
Rep:
|
Is this response on serverfault not correct? (Skip to "You can have your cake and eat it too")
http://serverfault.com/questions/357...for-my-website
|
|
|
|
01-13-2013, 03:56 AM
|
#5
|
|
Senior Member
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,624
|
It is correct, but you've misinterpreted it. As I understand it, they are trying to limit the capabilities of the www-data user! (compare it with the "Single user" scenario above). They want r-x permissions for the www-data user, and rwx permissions for the developers, who will be in the dev-fabrikam group. So the permissions function exactly as they want them to.
|
|
|
|
01-13-2013, 04:26 AM
|
#6
|
|
LQ Newbie
Registered: Jul 2009
Location: Morgan Hill, CA
Distribution: Ubuntu
Posts: 20
Original Poster
Rep:
|
I am not the owner of the directory. I am a member of the group. I cannot access the directory.
|
|
|
|
01-13-2013, 05:10 AM
|
#7
|
|
LQ Newbie
Registered: Jul 2009
Location: Morgan Hill, CA
Distribution: Ubuntu
Posts: 20
Original Poster
Rep:
|
What am I misunderstanding?
|
|
|
|
01-14-2013, 05:26 AM
|
#8
|
|
Senior Member
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,624
|
Sorry, are you saying you can't reproduce these steps:
Code:
$ whoami
joshua
$ pwd
/home/joshua/test
$ groups
users sudo
$ mkdir newfolder
$ sudo chown nobody newfolder
$ sudo chmod 570 newfolder
$ ls -ld newfolder
dr-xrwx--- 2 nobody users 4096 Jan 14 11:20 newfolder
$ ls -l newfolder
total 0
$ cd newfolder
$ ls
$ touch a_file
$ ls
a_file
$ pwd
/home/joshua/test/newfolder
$
I am a member of the group users, and I am not the user "nobody", and I can cd into the folder, ls its contents, and create new files.
If your system doesn't work correctly like that, can you post the output of you trying to do what I did above, please?
|
|
|
|
01-14-2013, 11:50 PM
|
#9
|
|
LQ Newbie
Registered: Jul 2009
Location: Morgan Hill, CA
Distribution: Ubuntu
Posts: 20
Original Poster
Rep:
|
Sorry, forgot to update the thread. The issue was solved with a reboot. Very embarrassing. That's now SOP when I'm considering a post. I was really confounded by why 570 didn't work. However, I did learn one interesting thing: setuid is ignored in linux, in case you were wondering.
|
|
|
|
01-15-2013, 01:47 AM
|
#10
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
Quote:
|
setuid is ignored in linux
|
Huh?? I beg to differ, unless you mean on scripts (eg .sh, pl etc), in which case you are correct 
|
|
|
|
01-16-2013, 06:18 PM
|
#11
|
|
LQ Newbie
Registered: Jul 2009
Location: Morgan Hill, CA
Distribution: Ubuntu
Posts: 20
Original Poster
Rep:
|
Quote:
Originally Posted by chrism01
Huh?? I beg to differ, unless you mean on scripts (eg .sh, pl etc), in which case you are correct 
|
On directories, the setuid permission is ignored, but setguid can be used. I learned it from the Wikipedia article and then I tested on my own system and it is correct. Files created in Linux are always owned by the creator, except possibly under ACL, which I don't know anything about.
|
|
|
|
01-17-2013, 02:45 AM
|
#12
|
|
Member
Registered: Dec 2012
Location: Tampa, FL
Distribution: Slackware, FreeBSD, CentOS
Posts: 37
Rep: 
|
I was just thinking about that prior to reading the whole discussion on the group being limited to the permissions of the file owner. If you recently added a user to a group, you usually need to log out and log back in as that user. A reboot would do the same thing. I'm not sure if there is a simpler way of having group changes take effect but simply logging in again should do it.
Last edited by wstewart; 01-17-2013 at 06:53 AM.
|
|
|
|
01-17-2013, 06:33 AM
|
#13
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
I see; I've never tried it (suid) on a dir 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:45 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
|
|