LinuxQuestions.org
Visit Jeremy's Blog.
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 04-16-2013, 03:31 PM   #1
Casper36410
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Rep: Reputation: 0
Unhappy 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
 
Old 04-16-2013, 05:55 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
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.
 
Old 04-16-2013, 06:28 PM   #3
Casper36410
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 04-16-2013, 06:43 PM   #4
Casper36410
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
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

Last edited by Casper36410; 04-16-2013 at 06:48 PM.
 
Old 04-16-2013, 07:01 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
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.
 
Old 04-16-2013, 07:40 PM   #6
Casper36410
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 04-16-2013, 08:30 PM   #7
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
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/
 
  


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
How to setup file permissions for multiple groups/users that use Windows AND Linux unassassinable Linux - Security 4 11-02-2010 09:00 PM
How do I setup LDAP auth of users/groups on Debian 5.0? peterson.julia Linux - Newbie 1 08-08-2010 01:29 AM
[SOLVED] setup environment variables for groups Jerry Mcguire Linux - Newbie 2 06-16-2010 11:01 PM
user accounts and groups setup is_numeric Linux - Newbie 2 10-26-2009 01:43 PM
groups for setup jma02740 Linux - Newbie 1 04-13-2004 02:52 PM


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