LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 12-09-2015, 01:17 PM   #1
DotSlashAttack
LQ Newbie
 
Registered: Sep 2015
Location: Charleston, SC
Distribution: Debian Jessie, Fedora, Ubuntu, Zorin
Posts: 6

Rep: Reputation: Disabled
Question Permissions and Groups


Ok...I'm experimenting with different methods of granting and restricting file access (no particular use case just poking around to get better).

I've created a file 'test.txt'. I've assigned the file to be owned by root.

I then created a group called "RESTRICTED" and added myself to that group. I then chgrp to assign test.txt to the RESTRICTED group.

I set the permissions on the file to 700 - I cannot access the file.
I set the permissions on the file to 704 - I can now access the file.


ls -l output:
-rwx---r-- 1 root RESTRICTED 12 Dec 9 13:30 test.txt

If I am part of the RESTRICTED group I should't have access.
My understanding is this:

Root should have RWX
Members of RESTRICTED should have no access
All other users who are not root or members of RESTRICTED should have read only access.

Am I wrong in my understanding of permissions and how they work?

Last edited by DotSlashAttack; 12-09-2015 at 01:19 PM.
 
Old 12-09-2015, 01:30 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
if i were to draw a ven diagram, root and the restricted users would exist in the set of all people in the world.

Last edited by schneidz; 12-09-2015 at 01:32 PM.
 
Old 12-09-2015, 06:26 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
The last set of perms is 'other' ie 'world'.
The system starts from the left looking for any kind of access, so owner, then group, then other.
Your setup just means you can't access it via the group perms; it says you can access it via 'other' perms.
http://linux.die.net/man/1/chmod
 
Old 12-09-2015, 06:35 PM   #4
DotSlashAttack
LQ Newbie
 
Registered: Sep 2015
Location: Charleston, SC
Distribution: Debian Jessie, Fedora, Ubuntu, Zorin
Posts: 6

Original Poster
Rep: Reputation: Disabled
That's where I'm a little confused - user (owner), group, others - seems that all others would include people not in group. Still not sure why users in the group would have access.
 
Old 12-09-2015, 06:40 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Like we both said other=world ie anyone/everyone AND perm sets (u, g, o) are considered separately(!).
You have access as part of the 'other' set.
Have a read of that link.
 
Old 12-09-2015, 06:51 PM   #6
DotSlashAttack
LQ Newbie
 
Registered: Sep 2015
Location: Charleston, SC
Distribution: Debian Jessie, Fedora, Ubuntu, Zorin
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks. I don't need the man page.

So there's no option but to create a group which has access and deny access to everyone else. Pretty inefficient when only certain people need to be excluded. In a group of 50, I would have to add 48 to a group with access while only 2 would be left in other. Rather, adding 2 to a restricted group would be more convenient and efficient.

Last edited by DotSlashAttack; 12-09-2015 at 06:54 PM.
 
  


Reply

Tags
chgrp, chmod, groups, permissions



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
permissions and groups deadeyes Linux - Security 3 03-05-2007 01:24 AM
Help with groups / permissions Rustylinux Linux - General 7 02-19-2007 12:15 PM
groups and permissions g_trueblood Slackware 2 10-07-2005 04:36 AM
File Permissions, X and Groups mikemrh9 Linux - Software 3 09-08-2005 09:10 PM
users/groups and permissions.... muman Linux - Newbie 2 09-21-2004 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:36 PM.

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
Open Source Consulting | Domain Registration