LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 10: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, 10:23 AM   #2
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 22
primary/default group

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

Welcome to LQ!
 
Old 02-22-2009, 10:28 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
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, 12:50 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
You may need to log out as these users before testing. Also run "sudo /usr/sbin/grpck".
 
Old 02-23-2009, 02: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, 11:14 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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-24-2009, 12:48 AM   #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


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


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