473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Group Permissions for Files

Colloid Snake
144 100+
Hello-

I am attempting to lock down a server I am working on, and the one thing I'm stuck at is modifying permissions for files. I can change the owner, group, and general users portion (and the file I am currently looking at has a rwxr-x--- permissions), but I was wondering how to associate that file to a group - make it so those permissions apply to a certain group. Is that based on the groups the owner of the file is in?

Any help on this would be appreciated,

~Snake
Jan 14 '08 #1
3 1955
prn
254 Expert 100+
Hi Snake,

You're close. The group permissions are generally permissions applicable to the group that the owner belongs to. If the owner is in group "staff" and sets group permissions to allow read access, then other members of "staff" can read the files.

It's actually a bit more complicated than that, though. Files have an individual owner and a group owner. The group may or may not have any real connection to the individual owner, but that is the most common case. When you do a directory in the "long" form (ls -l) both the owner (user) and the group are displayed. Root can chgrp the files so that some group that the owner doesn't even belong to is the relevant group, but that is unusual.

Secondary groups are often the main way of setting group-type permissions in *ix. Set up a non-user "owner" for a set of files and add the appropriate users to the same group. For example, we have an application "matlab" with a license agreement that specifies that only certain types of users should be able to use it. So we create a dummy user "matlab" to own the files, and a group "mlgroup" (I gave the group a different name from the owner just for illustration. It would work just as well if the group is named "matlab" and that is, as often as not, how actual installations set it up.) and then grant membership in the "mlgroup" to the appropriate users. If the directory "/usr/local/matlab" where matlab resides is set as 770 then the owner and other members of the mlgroup will have full access and others will have no access.

HTH,
Paul
Jan 14 '08 #2
Motoma
3,237 Expert 2GB
Hello-

I am attempting to lock down a server I am working on, and the one thing I'm stuck at is modifying permissions for files. I can change the owner, group, and general users portion (and the file I am currently looking at has a rwxr-x--- permissions), but I was wondering how to associate that file to a group - make it so those permissions apply to a certain group. Is that based on the groups the owner of the file is in?

Any help on this would be appreciated,

~Snake
Hi Snake,

Users and Groups are a many to many relationship. Files to groups is a many to one relationship. That is to say, a file can belong to only one group, however, a group can have many files, while a user can be part of many groups, and a group can have many users.

chgrp and chown are two ways to change the group that a file belongs to.

Motoma
Jan 15 '08 #3
Colloid Snake
144 100+
Thanks guys. I thought I did that, but it was set up by user before the user was associated with the group (though by the same name as the group), so I will try it again.

Thanks!
Jan 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tracy Tripp | last post by:
I'm working on a program that takes files by path and moves them into new locations, and then back again if the user intends. Everything is great so far except I cannot figure out how to keep...
1
by: Angelo | last post by:
I have a user (john.doe) as a member of a group (MyGroup). I have assigned group permission to view and run the queries of that db but then when I log in with that user, I still can't access the...
10
by: John Salerno | last post by:
I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755...
0
by: beary | last post by:
I need some advice re permissions etc. Here's the situation: at my workplace, I have a website which sits in a folder created by the IT manager, and given certain permissions (I'm not even yet sure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.