LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to do setup groups, but can't get them working. (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-do-setup-groups-but-cant-get-them-working-4175458356/)

Casper36410 04-16-2013 02:31 PM

Trying to do setup groups, but can't get them working.
 
I have two users. (A and B) user A has a directory I want user B to be able to access, but not the others within user A's home directory. I've add second groups to the two accounts, but I can't seem to get it to work. What am I doing wrong or is this the right what to do this?

Thanks in Advance

jpollard 04-16-2013 04:55 PM

Access to files is based on the group ownership of the files. By default the user that creates the file will give the default owner and the group inherited from the group of the directory the file is created in.

If a directory is created AND has the group owner changed appropriately, then files created within that directory should have the correct group ownership.

Access to files though, is also controlled by access to the containing directories... If the owners home directory is not accessible to the user, then files within will not be accessible either, even if the group of the file DOES permit access.

Casper36410 04-16-2013 05:28 PM

So user A's home directory need to have the group set too? The next folder that I only want user B to have access to has the same group?

http://pastebin.com/cbgPgfvs

Maybe this would help.

Casper36410 04-16-2013 05:43 PM

Figured it out. instead of ln -s directory I need to do ln -s -f directory
My mistake it didn't fix it. I was in a different user

chrism01 04-16-2013 06:01 PM

Good advice from jpollard.

If you don't trust userB, create a new acct just for sharing files and put A & B in the associated group.
You probably also want to set
Code:

chmod g+s dir
on the dir to ensure files create by either user are set to the associated group owner.

Casper36410 04-16-2013 06:40 PM

Still unable to figure it out. I create the symbolic link in user B's account to A's, but when I try accessing it through the symbolic link I get "Permission Denied.

Is there any information I can give you or maybe a guide. I've been googling this entire time.

chrism01 04-16-2013 07:30 PM

Forget symlink; as above, B would need access to A's dirs.
Try my soln above.

Basic steps

1. create new acct for sharing eg ashare, with home dir /home/ashare and group ashare
2. chmod g+s /home/ashare
3. add A & B to group ashare as secondary group http://www.cyberciti.biz/faq/howto-l...user-to-group/

more useful links
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/


All times are GMT -5. The time now is 04:08 PM.