| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| 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. |
|
 |
03-18-2009, 02:16 PM
|
#1
|
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Rep:
|
Changing permission on a folder so group users can Read and Write
Hi.
I was searching for this sometime now and didn't find any answer.
First of all I have to say that I know that I can just use the umask in /etc/profile so any file could be created with the mask set. But I need something that work only for this particular folder.
I have a shared folder used by some users:
rw-rw--- root:develop /home/share
and I want Bob and Joe to be able to write in this folder both belongs to group develop. Bob and Joe can write in the folder, but they can't edit each other files because every file created is made with the 022 umask and I need they goes with 006 (rw-rw---).
How can I solve this? Remember, seting a global umask isn't a good idea since I just need this kind of permission in this folder.
Thks [ ]'s
best regards
|
|
|
|
03-18-2009, 03:49 PM
|
#2
|
|
Member
Registered: Nov 2006
Location: Indiana, U.S.A.
Distribution: Red Hat Enterprise Linux, Fedora, and others as time allows.
Posts: 134
Rep:
|
setgid
I believe that you're looking for setgid which is applied using the chmod command. Setgid causes new files and subdirectories created within it to inherit its groupID, rather than the primary groupID of the user who created the file.
Code:
chmod g+s /home/share/
Note: This setting only affects new creations of files and subdirectories. Any existing files and subdirectories will have to be changed manually.
|
|
|
|
03-19-2009, 01:32 AM
|
#3
|
|
ELF Statifier author
Registered: Oct 2007
Posts: 648
Rep: 
|
Quote:
Originally Posted by Linville79
I believe that you're looking for setgid which is applied using the chmod command. Setgid causes new files and subdirectories created within it to inherit its groupID, rather than the primary groupID of the user who created the file.
Code:
chmod g+s /home/share/
Note: This setting only affects new creations of files and subdirectories. Any existing files and subdirectories will have to be changed manually.
|
While setgid directory (and umask = 002) technically solve the problem,
what is a reason in the first place for such setup ?
Usually it's mean than one have to use some kind of version control software.
|
|
|
|
03-20-2009, 08:35 AM
|
#4
|
|
Member
Registered: Nov 2006
Location: Indiana, U.S.A.
Distribution: Red Hat Enterprise Linux, Fedora, and others as time allows.
Posts: 134
Rep:
|
Quote:
Originally Posted by Valery Reznic
While setgid directory (and umask = 002) technically solve the problem,
what is a reason in the first place for such setup ?
Usually it's mean than one have to use some kind of version control software.
|
That's a good point. If you have multiple developers that are working on the same set of files, it is far better practice to employ something like Subversion for source control where each developer can maintain their own trunks and then merge those into the production version as needed.
The best part of using a source control software, is that they provide automatic versioning, and allow for code rollbacks to previous versions if something gets broken.
The bottom line is, there are multiple ways to accomplish your goals, you just need to make sure that you're selecting the one that best fits your needs and your environment.
|
|
|
|
03-20-2009, 08:40 AM
|
#5
|
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Original Poster
Rep:
|
Okay, but this dont make the new files created under that folder to keep the folder mode, the files created are inheriting the umask mode in this case 022 wich doesnt solve my problem ...
see, I need the files to be created JUST in this folder with umask 006. If I do like Valery wrote I will have to set the umask for all files created by the user no matter where he creates it and this is something that I dont want.
[ ]'s
|
|
|
|
03-20-2009, 01:45 PM
|
#6
|
|
ELF Statifier author
Registered: Oct 2007
Posts: 648
Rep: 
|
Quote:
Originally Posted by maginotjr
Okay, but this dont make the new files created under that folder to keep the folder mode, the files created are inheriting the umask mode in this case 022 wich doesnt solve my problem ...
see, I need the files to be created JUST in this folder with umask 006. If I do like Valery wrote I will have to set the umask for all files created by the user no matter where he creates it and this is something that I dont want.
[ ]'s
|
Could you explain what is this folder for ?
I never before faced situation when such arrangement was needed
|
|
|
|
03-27-2009, 02:50 PM
|
#7
|
|
Member
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661
Original Poster
Rep:
|
Here we use a LTSP service and so everybody is using the same box as thin client server then when someone need to share something they use the share folder inside /home/share/sector. So I created a group for wich sector and those users of that sector inside it.
This is why I need something like this and could not comprimisse the default umask or I will be opening a way for the users see things that are not allowed.
|
|
|
|
03-27-2009, 03:22 PM
|
#8
|
|
ELF Statifier author
Registered: Oct 2007
Posts: 648
Rep: 
|
Quote:
Originally Posted by maginotjr
Here we use a LTSP service and so everybody is using the same box as thin client server then when someone need to share something they use the share folder inside /home/share/sector. So I created a group for wich sector and those users of that sector inside it.
This is why I need something like this and could not comprimisse the default umask or I will be opening a way for the users see things that are not allowed.
|
I still don't get while you can't change default umask to 002.
Obviously it's OK for shared folder.
Where it'll create problem ? With users' home directories ?
|
|
|
|
| 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 11:08 AM.
|
|
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
|
|