setting up a shared folder in linux

Posted by Chris on Super User See other posts from Super User or by Chris
Published on 2012-09-10T02:13:59Z Indexed on 2012/09/10 3:40 UTC
Read the original article Hit count: 567

Filed under:
|
|
|

I'm trying to set up a folder in my home directory that will be shared with another user but for some reason it is not working this is what I've done, I have tried two different ways using ACL's and chown/chgrp etc

I set up a group called say: sharedgroup and added both my user (john) and fred to it so when I run

groups john

john wheel sharedgroup

groups fred

sharedgroup fred 

mkdir /home/john/shared

vim /home/john/shared/hello.txt (typed in some text saved it)

chown -R :sharedgroup shared

chmod -R o=-rwx shared

ll

drwxrwx--- 2 john sharedgroup 4096 Sep 9 21:14 shared

ll shared

-rw-rw-r-- 1 john sharedgroup 7 Sep 9 21:14 hello.txt
(I also tried adding in the s permissions but that didn't help either)

then when I log out of the server and log back in as fred and try these commands they fail

vim /home/john/shared/hello.txt (won't allow me to write opens a blank file)    

cd /home/john/shared
-bash: cd: /home/john/cis: Permission Denied


ls /home/john/shared

-ls: /home/john/shared: Permission Denied

ls -lad /home/john/shared

-ls: /home/john/shared: Permission Denied



id fred
uid=500(fred) gid=502(sharedgroup) groups=502(sharedgroup),500(fred) context=user_u:system_r:unconfined_t

Any idea what I'm doing wrong??

© Super User or respective owner

Related posts about permissions

Related posts about folder