LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-22-2009, 09:13 AM   #1
Afante
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Rep: Reputation: 0
Question HELP! Share directory permission problem


Hi,

I want to share a directory prj between two existent accounts A and M.
I did the following:

As root:
$ mkdir /home/prj
$ groupadd workgroup
$ chgrp workgroup /home/prj
$ usermod -G workgroup A
$ usermod -G workgroup M
$ usermod -G workgroup root
$ chmod 770 /home/prj

As either A or M:
$ ls /home/prj
ls: /home/prj: Permission denied

Can anyone tell me what is wrong? And how should I set directory permissions and ownerships so that prj can be accessed by A and M but not by all others?
 
Old 02-22-2009, 09:23 AM   #2
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
primary/default group

Try making "workgroup" the primary or default group for each of those users.

Welcome to LQ!
 
Old 02-22-2009, 09:28 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Please ls -al /home
And note this from man usermod
Code:
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
           A list of supplementary groups which the user is also a member of.
           Each group is separated from the next by a comma, with no
           intervening whitespace. The groups are subject to the same
           restrictions as the group given with the -g option. If the user is
           currently a member of a group which is not listed, the user will be
           removed from the group. This behaviour can be changed via the -a
           option, which appends the user to the current supplementary group
           list.
So I think you might have messed up the groups for the users A M and root
What is the output of groups when run as user A?
 
Old 02-22-2009, 11:50 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You may need to log out as these users before testing. Also run "sudo /usr/sbin/grpck".
 
Old 02-23-2009, 01:55 AM   #5
Afante
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you all!!

Quote:
Originally Posted by jschiwal View Post
You may need to log out as these users before testing. Also run "sudo /usr/sbin/grpck".
That's the problem! Now I gain access to the shared directory.

Thank you everyone!
 
Old 02-23-2009, 10:14 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
And in an interactive session you can avoid logging out
by just typing "newgrp <group_name>" (note: this is only
valid for the current shell).


Cheers,
Tink
 
Old 02-23-2009, 11:48 PM   #7
Afante
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
And in an interactive session you can avoid logging out
by just typing "newgrp <group_name>" (note: this is only
valid for the current shell).


Cheers,
Tink

Thank you very much!
 
  


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
share directory with samba domain user permission neo571 Linux - Networking 4 12-02-2008 05:37 AM
permission problem samba share 2nd suse server activeq Linux - Software 0 01-04-2007 07:30 AM
apche permission problem after i mount windows share in linux niloshima Linux - Networking 1 12-20-2005 09:05 PM
Samba - permission problem on multiple user share timmywo Linux - Software 1 08-06-2005 05:30 PM
Directory permission problem elderain Linux - Newbie 6 05-24-2004 11:25 AM

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

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