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.
|
 |
11-06-2009, 02:54 PM
|
#1
|
Member
Registered: Sep 2009
Posts: 36
Rep:
|
Question about File Permissions / Default groups
Hi,
I created a folder named /projects. If I use a tool like NetBeans it defaults to the user and group I am using, so anything created on this folder goes under that permission. Now I want also another user to be able to touch those files like 'rwx', so I created a group which had those two users, then grant the group to the folder. Problem is everytime I create a file using the other user, I need to change also the group of that file so the other user can touch it. Is there a better way of doing this? Thanks.
|
|
|
11-06-2009, 03:27 PM
|
#2
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083
|
RCS's are a way to solve this: git, svn, mercurial, bazaar, etc.
|
|
|
11-06-2009, 04:05 PM
|
#3
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
|
What is your umask setting? If it is removing group read/write privileges, then you can change it accordingly. The value of umask is a bitmap like the file permissions bitmap, but 'inverted'. A bit set in the umask prevents applications from allocating the accordant permission when creating files.
Example:
Code:
umask=0000
touch touch0000
umask=0022
touch touch0022
umask=0077
touch touch0077
ls -l
-rw-rw-rw- 1 thenbomr groupnbomr 0 Nov 6 13:57 touch0000
-rw-r--r-- 1 thenbomr groupnbomr 0 Nov 6 13:56 touch0022
-rw------- 1 thenbomr groupnbomr 0 Nov 6 13:59 touch0077
Also, you can change the default group for each user. Make all members of a project have the same default group.
--- rod.
Last edited by theNbomr; 11-06-2009 at 04:08 PM.
|
|
|
11-07-2009, 12:17 PM
|
#4
|
Member
Registered: Sep 2009
Posts: 36
Original Poster
Rep:
|
Thanks for the replies. Yeah I thought of doing version controls but since I'm the only one using my PC, that would only create copies of the file for each user. I use the main user ( the one I login on X, to run my dev tools ), then I use the other user - oracle, to run db scripts ( which I code in my dev tool ) and other db admin tasks. So I just thought If I'd go for version control for that, then I'd have checkin/checkout for both users.
As for the umask, is it possible to set it on a folder level? I mean all files created under it will have grants base on the umask marked on it?
I think also one way of fixing this is to give the grants also to my login user so it can also do database admin tasks, not sure if that's possible though.
I'll do some more reading. Thanks again.
|
|
|
11-07-2009, 02:00 PM
|
#5
|
LQ Newbie
Registered: Jul 2009
Distribution: slackware 13
Posts: 21
Rep:
|
as suggested by theNbomr you should change your umask
something similar to that.
make sure the group owner of the directory you created is the group you created, then add the SET GID special permission so objects created in the directory inherit its GID
Code:
chmod 2775 /projects
the important part is the 2
Last edited by gerryd; 11-07-2009 at 02:01 PM.
|
|
|
11-07-2009, 05:29 PM
|
#6
|
Member
Registered: Sep 2009
Posts: 36
Original Poster
Rep:
|
Thank you very much. That worked. It's much clearer now =)
This article also helped.
|
|
|
All times are GMT -5. The time now is 07:01 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
|
|