LinuxQuestions.org
Register a domain and help support LQ
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-14-2010, 12:28 AM   #1
ardaneh
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
Smile permissions


hi, im new in Linux
i have 5 groups, i want to set 3 of them to have full permissions to a folder and set 2 others with read only to same folder, please help me to solve this problem.
in other words i want to set this 5 groups diffrent permissions to a folder.
tanx
 
Old 11-14-2010, 02:20 AM   #2
LoadMeisterGeneral
LQ Newbie
 
Registered: Nov 2010
Location: the Netherlands
Distribution: Ubuntu 10.04, Arch Linux
Posts: 6

Rep: Reputation: 0
Hello Ardaneh,

I am also a newby. Maybe you should mention the distribution that you are using. I have recently started with Arch Linux. For Arch Linux there is an excellent Beginners' Guidehttps://wiki.archlinux.org/index.php/Beginners'_Guide. Maybe also helpful for other distro's.

Good luck!
 
Old 11-14-2010, 02:20 AM   #3
LoadMeisterGeneral
LQ Newbie
 
Registered: Nov 2010
Location: the Netherlands
Distribution: Ubuntu 10.04, Arch Linux
Posts: 6

Rep: Reputation: 0
Hello Ardaneh,

I am also a newby. Maybe you should mention the distribution that you are using. I have recently started with Arch Linux. For Arch Linux there is an excellent Beginners' Guidehttps://wiki.archlinux.org/index.php/Beginners'_Guide. Maybe also helpful for other distro's.

Good luck!
 
Old 11-14-2010, 02:44 AM   #4
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
Hi ardaneh,

you could create a new group for all users that have full permissions on this folder. (adding a group to a group is not possible)
Code:
groupadd admins
useradd -G admins user1
useradd -G admins user2
...
Then you can associate this group to the folder.
Code:
chgrp admins /home/xyz/folder1
And give the group full permissions.
Code:
chmod g+rwx /home/xyz/folder1
For the other groups which should have read only access. If you can accept that everybody!,not only the other groups, can read the folder you can set the read permissions like this:
Code:
chmod o-wx+r /home/xyz/folder1
If you don't want to allow everybody to read this folder and really only for a group you can use ACLs for it. But the partition of the folder must be mounted with acl option. Then set it like this:
Code:
setfacl -m group:admins:rwx,group:dbadmins:r /home/xyz/folder1
The group "admins" has full access, the group "dbadmins" has only read access. (These groups must exist, so you have to create them with groupadd before.)

Linux permissions easy

hope this helps
 
Old 11-14-2010, 04:06 AM   #5
ardaneh
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Smile Tanx

tanx for reply, but i dont get my answer, maybe i said it wrong,let me say it in another way:
i have 3 groups, A, B and C, that i want to set full permissions for group A to a folder and i want to set read only permission for group B to same folder and set write permission for group C to same folder, how i can do it, set different permissions for different groups to one folder.
 
Old 11-14-2010, 04:24 AM   #6
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
With 3 groups it would look like this:
Code:
setfacl -m group:admins1:rwx,group:admins2:r,group:admins3:w /home/xyz/folder1
 
Old 11-14-2010, 04:43 AM   #7
brahups
LQ Newbie
 
Registered: Sep 2009
Location: Bangalore
Distribution: Fedora, RHEL5, Centos
Posts: 2

Rep: Reputation: 0
if you want to check the acl , use command getfacl /folder , it will shows all the access control list permission details of the particular folder.
 
Old 11-14-2010, 02:25 PM   #8
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 524
Blog Entries: 3

Rep: Reputation: 116Reputation: 116
Lightbulb

If these users are not local users (with UNIX accounts on the machine), and you want to do this for say, a network sharepoint, you can also achieve the same granularity level w/smb.conf (running SAMBA).

For example, your users are all wyndoze users, and have wyndoze boxes they are accessing these folders from their workstations (a very common use for UNIX servers, as is NFS).

So you install SAMBA, configure it for these groups w/access levels appropriate to their jobs, and all is good.

One scenario I typically use is to create a domain, use kixtart for the logon scripts and to map out their home (H:\) and public (P:\) sharepoints and no one even has to know that UNIX isn't a reference to someone living in times of Tiberius.

A good reference for setting up a SAMBA domain, ironically, is located HERE

And there's a plethora of wealth on Login scripts, including many examples which you can freely download HERE

Otherwise, ACLs are the way to go in your case, as eloquently demonstrated to you above in an earlier post

Hope that helps!
 
Old 11-19-2010, 02:07 AM   #9
mirzasoltan
LQ Newbie
 
Registered: Oct 2010
Posts: 28

Rep: Reputation: 0
tanx everyone
i solve my problem with your helps, thank you.
good luck every one
 
Old 11-19-2010, 07:00 AM   #10
albertgonzo
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Rep: Reputation: 0
I dont even know if im posting right..I have debian linux and I cant edit the clamav.conf /etc/clamav
I tried several editors like leafpad and gedit but the trash and delete buttons are greyed out and i edit the clam file but when i try to save ..no permmissions am not allowed to edit readonly file ,
I did the ls -l deal and the clam is listed as my property rw -r -r how come?
 
Old 11-20-2010, 03:30 AM   #11
norbert74
Member
 
Registered: Apr 2006
Posts: 63

Rep: Reputation: 23
albertgonzo, please execute the following two commands. And if it is still not obvious why you can't modify the file post the output.
Code:
id
ls -lh /etc/clamav/clamav.conf
 
Old 11-20-2010, 01:31 PM   #12
tallship
Member
 
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 524
Blog Entries: 3

Rep: Reputation: 116Reputation: 116
Lightbulb

Quote:
Originally Posted by albertgonzo View Post
I dont even know if im posting right..I have debian linux and I cant edit the clamav.conf /etc/clamav
I tried several editors like leafpad and gedit but the trash and delete buttons are greyed out and i edit the clam file but when i try to save ..no permmissions am not allowed to edit readonly file ,
I did the ls -l deal and the clam is listed as my property rw -r -r how come?
I would imagine something like:

Code:
# apt-get clamav
Would be the first step on Debian.

On Slackware, you would start HERE

Hope that helps
 
Old 11-22-2010, 11:42 PM   #13
albertgonzo
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Rep: Reputation: 0
i tried these things ..first ls -lh /etc/clamav/clamav.conf = no such file or directory
then tried apt-get install clamav -message "E:could not open lock file /var/lib/dpkg/lock - open (13 permission denied)" "E: unable to lock administration directory (/var/lib/dpkg/) are you root?
 
Old 11-22-2010, 11:47 PM   #14
tiredofbilkyyaforallican
Member
 
Registered: Aug 2010
Location: 3rd rock from the sun
Distribution: LMDE/Peppermint/Mint 9,&10/along with a few others
Posts: 152

Rep: Reputation: 22
Quote:
Originally Posted by albertgonzo View Post
i tried these things ..first ls -lh /etc/clamav/clamav.conf = no such file or directory
then tried apt-get install clamav -message "E:could not open lock file /var/lib/dpkg/lock - open (13 permission denied)" "E: unable to lock administration directory (/var/lib/dpkg/) are you root?
type sudo apt-get install clamav
 
Old 11-22-2010, 11:58 PM   #15
albertgonzo
LQ Newbie
 
Registered: Nov 2010
Posts: 6

Rep: Reputation: 0
I chmod 777 /etc/sudoers and operation not permitted..i dont know very much linux...but i do know this is my computer and i aint gonna let no machine tell me how to run my machine....LOL
 
0 members found this post helpful.
  


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
[SOLVED] filesystem permissions question - making so user can't change permissions? c0pe Linux - Security 4 07-12-2010 10:06 AM
[SOLVED] Lack basic understanding of permissions(apache permissions problem) cK` Linux - Newbie 7 04-09-2010 12:49 AM
File permissions v. directory permissions Completely Clueless Linux - Newbie 7 07-09-2009 09:33 AM
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 01:00 PM
getting a directory's permissions and creating a new one with the same permissions newbie1000101 Programming 1 04-10-2004 01:52 PM


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