LinuxQuestions.org
Help answer threads with 0 replies.
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 07-17-2011, 05:34 PM   #1
Krayons
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Rep: Reputation: Disabled
File Permission and Groups


Hi,

I have been trying to to make the folder "/home/files" Read/write/Execute for the group "admin" and only Read for Group "Friends"

Thanks in advance.
Kyle
 
Old 07-17-2011, 05:57 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ Reply

Hi Kyle,

Welcome to LQ!!!

As you already have folder in place perform the following steps:

1. chown nobody.admin /home/files
2. chmod 2774 /home/files

This will give read/write/execute access to admin group and will limit read only access for others.

If you are specific that only friends group get read only rights to this folder and no one else then perform the following steps and ignore the above steps:

1. chown nobody.admin /home/files
2. chmod 2770 /home/files
3. setfacl -m group:friends:r-x /home/files

You are using r-x (read and execute) with acl because without execute you won't be able to get into the directory. For cd you need to have execute rights when working with acl.

Last edited by T3RM1NVT0R; 07-17-2011 at 05:59 PM.
 
1 members found this post helpful.
Old 07-17-2011, 06:00 PM   #3
Krayons
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks. Worked perfectly!

Edit:

How would
chown nobody.admin /home/files
be different from
chown :admin /home/files (what I saw else where)

Last edited by Krayons; 07-17-2011 at 06:02 PM. Reason: See edit.
 
Old 07-17-2011, 06:02 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
@ Reply

Great!!! Good to hear that. Enjoy Linux!!!
 
Old 07-17-2011, 06:43 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
The chown cmd has up to 3 args (plus options)

owner
group
file/dir

by default
Code:
chown owner file
defaults to changing the owner (its always the first arg).
You can specify owner and group at the same time, separated by colon
Code:
chown owner:group file
to change group only, omit owner in the above
Code:
chown :group file
http://linux.die.net/man/1/chown

Alternately, use chgrp http://linux.die.net/man/1/chgrp
 
  


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
invalid group id redhat linux as 5 - all groups in group file are invalid groups nlong1 Red Hat 1 02-15-2009 04:43 AM
Two groups that have different permission to the same directory - it's possible? immer Linux - Newbie 7 10-22-2004 06:00 AM
groups and file rights tstuhr Linux - Networking 1 10-05-2001 02:06 PM


All times are GMT -5. The time now is 07:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration