LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 11-06-2009, 03:54 PM   #1
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Rep: Reputation: 16
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.
 
Old 11-06-2009, 04:27 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
RCS's are a way to solve this: git, svn, mercurial, bazaar, etc.
 
Old 11-06-2009, 05:05 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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 05:08 PM.
 
Old 11-07-2009, 01:17 PM   #4
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
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.
 
Old 11-07-2009, 03:00 PM   #5
gerryd
LQ Newbie
 
Registered: Jul 2009
Distribution: slackware 13
Posts: 21

Rep: Reputation: 1
as suggested by theNbomr you should change your umask
Code:
umask 0002
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 03:01 PM.
 
Old 11-07-2009, 06:29 PM   #6
mortonmorton
Member
 
Registered: Sep 2009
Posts: 36

Original Poster
Rep: Reputation: 16
Thank you very much. That worked. It's much clearer now =)

This article also helped.
 
  


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
Does root belong to all groups - Permissions Question Cocytus1 Linux - Newbie 4 04-26-2008 04:50 PM
groups and file/folder permissions jon23d Linux - General 11 09-13-2006 08:22 PM
File permissions for groups in Suse 9.3 adrenaline_NZ SUSE / openSUSE 2 12-13-2005 01:17 PM
File and directory permissions or groups kuplo Linux - Newbie 1 11-11-2005 04:06 AM
File Permissions, X and Groups mikemrh9 Linux - Software 3 09-08-2005 10:10 PM


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