Domanda

I have a samba share which I want to write too but not be able to read.

[writeonly]
path = /writeonly
read only = no
create mask = 0772
guest ok = yes
guest account = gpcw
hide unreadable = yes
public = yes
browsable = no
writeable = yes
force user = gpcw

The permissions on the folder (owned by root) are 0772 which I understand to mean rwx for root:root and -w- for any other user.

I can mount the share from a windows server using net use v: \\server\writeonly but when I try to write I get permission denied.

If I change the unix permission to 0776 or 0777 I can write to the folder, but it unfortunately becomes readable.

My question is this, am I looking at a quirk of how windows maps samba folders in that it requires a read before it can write or is there something more significant likely to be happening?

È stato utile?

Soluzione

I just did it by sharing the folder normally (to the Guest user) and then simply changing the folder's permissions to allow write and deny read to Guest, like so:

Write-only shared folder permissions

In my case it can also be accessed from OS X, where the Windows' shared folder is mounted but it looks empty/unopenable. This message pops up when copy files to it: You can put items into “Aggiunta Musica”, but you won’t be able to see them. Do you want to continue? Other users with sufficient permissions will be able to use the items.

If you need to share it from an OS other than Windows, look for ACL in your OS.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top