LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permissions (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-844149/)

ardaneh 11-13-2010 11:28 PM

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

LoadMeisterGeneral 11-14-2010 01:20 AM

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!

LoadMeisterGeneral 11-14-2010 01:20 AM

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!

norbert74 11-14-2010 01:44 AM

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

ardaneh 11-14-2010 03:06 AM

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.

norbert74 11-14-2010 03:24 AM

With 3 groups it would look like this:
Code:

setfacl -m group:admins1:rwx,group:admins2:r,group:admins3:w /home/xyz/folder1

brahups 11-14-2010 03:43 AM

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.

tallship 11-14-2010 01:25 PM

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!

mirzasoltan 11-19-2010 01:07 AM

tanx everyone
i solve my problem with your helps, thank you.
good luck every one

albertgonzo 11-19-2010 06:00 AM

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?

norbert74 11-20-2010 02:30 AM

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


tallship 11-20-2010 12:31 PM

Quote:

Originally Posted by albertgonzo (Post 4164222)
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 :)

albertgonzo 11-22-2010 10:42 PM

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?

tiredofbilkyyaforallican 11-22-2010 10:47 PM

Quote:

Originally Posted by albertgonzo (Post 4167728)
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

albertgonzo 11-22-2010 10:58 PM

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


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