You are not logged in.

#1 2010-04-18 14:57:35

jskier
Member
From: Minnesota, USA
Registered: 2003-07-30
Posts: 383
Website

How to maintain ownership, permissions for files/directories?

Sounds like a silly question, but I've tried a few things and can't seem to get there.

Basically, I have two directories (/dir1, /dir2) that are shared via NFS/CIFS. This is for a home network and it works great for the networked computers. However, I use this "server" machine as my workstation desktop as well. So, when I go to create files they automatically take my local user credentials (obviously when I enter the directory, but even when I try mounting the shares locally with NFS). I'd like these permissions to stay untouched (remain rw and keep the ownership of nobody:nobody).

So far I've tried mount with bind in fstab (99 is nobody):

/dir1 /home/user/Shared bind user,auto,uid=99,gid=99,bind 0 0

It still wants to append my user name / group to files saved under the Shared folder. I'd like it to not do this.

I've also looked at bindfs which seems promising, but there doesn't seem to be much documentation on pulling that off with FSTAB.

Anyone have any ideas or thoughts on this?


--
JSkier

Offline

#2 2010-04-18 23:11:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: How to maintain ownership, permissions for files/directories?

jskier wrote:

Anyone have any ideas or thoughts on this?

When I want to have a networked location shared without regard for ownership/permissions (eg, a "Shared" dumping location anyone on my network can access), I use Samba rather than NFS since you can enforce ownership and permissions on the server-side, and the client assumes that it's talking to a Windows server which doesn't support POSIX permissions so it doesn't try to maintain them:

[shared]
    comment = General shared data
    path = /srv/shared
    read only = no
    public = yes
    force user = nobody
    force create mode = 0666
    force directory mode = 0777

Offline

#3 2010-04-19 00:41:45

jskier
Member
From: Minnesota, USA
Registered: 2003-07-30
Posts: 383
Website

Re: How to maintain ownership, permissions for files/directories?

Eh, it works with my current setup just fine. Shall be suffice until I find something better, thank you smile


--
JSkier

Offline

#4 2010-05-13 12:57:39

jskier
Member
From: Minnesota, USA
Registered: 2003-07-30
Posts: 383
Website

Re: How to maintain ownership, permissions for files/directories?

I used bindfs from AUR and figured it out finally in case anyone is curious. This keeps the user and group nobody and full permissions for this directory.

bindfs#/files /home/user/Shared    fuse    user,rw,exec,sync,noatime,auto,create-for-user=nobody,create-for-group=nobody,create-with-perms=0777   0    0

--
JSkier

Offline

Board footer

Powered by FluxBB