1

I'm batch processing a lot of video files stored on an Unraid array with code running on Windows, accessing files on the array via SMB. Whenever I create a new MKV file it ends up flagged as user-executable (it's not an executable file type), with read/write permissions for everyone (766). I want the permissions to be 664 (readable by everyone, writable by user and group, executable by no one).

Since there's no Windows equivalent to chmod, can I at least, in some manner, set default permissions for any newly created file? I'd also like new directories to default to 775 permissions.

1 Answer 1

2

Not really, the file permissions are set by the host - the SMB protocol doesn't see or send unix permissions.

It looks like you could usually fix the execute bit by setting map archive = no in /etc/samba/smb.conf on the linux side. On the windows side though, you might be able to un-set the archive attribute (which samba maps to o+x). In CMD for example, you would run attrib -a filename (or +a to add).

The rest of the file permissions get determined by a combo of the rest of the samba config, the samba user's permissions, the parent folder's permissions, and file ACLs (if any) on the server side.

1
  • The SMB protocol does send NTFS permissions, which Samba usually maps to their corresponding Unix permissions (including even the Execute bit that has a 1:1 equivalent in NT). Oct 12, 2023 at 18:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .