LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 02: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, 04:55 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 05: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, 05: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 05:48 PM.
 
Old 04-16-2013, 06:01 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 06: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, 07:30 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 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
Open Source Consulting | Domain Registration