We use an Ubuntu 14.04 server as file server in our closed network. We use apple and windows workstations (SMB protocol). Sometimes we get problems when saving files to the server like 'Could not save "file name" because write access was not granted'. This is strange since all files and folders have the login in user as owner and 755 permissions. After checking such a file it has 764 rights (rwxrw-r--) and we get this message. Sometimes after multiple safe attempts it works. I run a cronjob now every hour to reset all permissions but it's annoying.

Anyone any advice or tips?

  • What is the create_mask setting in /etc/samba/smb.conf for the particular share? – Arronical Sep 27 '16 at 11:01
  • [data] path = /var/datamap comment = No comment valid users = skitter directory mask = 0774 create mode = 0774 read only = no available = yes browseable = yes writable = yes guest ok = no public = no printable = no locking = no strict locking = no So I see there this is not correct, thx for this.. But nevertheless this also should not give problems like we have right? – user3049694 Sep 27 '16 at 11:09
  • 1
    @user3049694 Please add the details directly into your question rather than a comment. – Melebius Sep 27 '16 at 11:21

Try to add the following directive in your [data] section:

force create mode = 755

This ensures the minimal level of mode when creating a file.

From the Samba manual:

This parameter specifies a set of UNIX mode bit permissions that will always be set on a file created by Samba. This is done by bitwise 'OR'ing these bits onto the mode bits of a file that is being created. The default for this parameter is (in octal) 000. The modes in this parameter are bitwise 'OR'ed onto the file mode after the mask set in the create mask parameter is applied.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.