Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used to copy files from one system to another system via samba. How ever I am getting the file only in read only mode. What i am doing now is i used to change the file permission after transferring the file. It seems to be little time consuming one. Is there any permanent solution to this problem?

Files are read-only after copying over samba

Still i have the same problem. Pls have a look @ my samba setup.


karthick@karthick:~$ groups            
karthick adm dialout cdrom plugdev lpadmin admin sambashare
share|improve this question
Did you remove the comments from smb.conf? Mine is full of commented instructions? Why is your create mask still set at 0700? Please read my answer on setting permissions for create mask (and no it is unlikely your remote user is the owner of these files but is either part of a 'group' or is 'others'. – Rinzwind May 28 '11 at 7:27
What should be the value for create mask ? – karthick87 May 28 '11 at 7:37
Easiest answer? 0755. More secure might be 0750 but that would assume both your local and remote user are part of the same group (type groups on command line to see what group you are part). – Rinzwind May 28 '11 at 7:44
Updated my question with required outputs, pls look at it. And what is the value i should set it for directory mask ? – karthick87 May 28 '11 at 8:06
up vote 12 down vote accepted

Configure create mask and directory mask in /etc/samba/smb.conf with the desired permissions.

from /etc/samba/smb.conf:

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700

If you need more information there is a man page on smb.conf.

Regarding the values for the masking:

Permissions 700 means:

                 : The 1st octet are permissions for the owner.
        r w x  T : The 2nd octet are permissions for the group.
Owner:  4 2 1  7 : The 3rd octet are permissions for everyone else.
Group:  0 0 0  0 : For each octet, start at 0 and:
Other:  0 0 0  0 :  +4 for read permission.
                 :  +2 for write permission.
                 :  +1 for execute permission.

So you need to figure out want permissions you need for the owner,group and others. Add the digits for read, write and execute for owner,group and other.

755 would r,w,x for owner; r,x for group and others.
777 would be r,w,x for all 3.


If you have problems with locks check if there is a *ldb file (that's the lock file) with permissions lower than 770. If their is check these settings and their values (values and workgroup are arbitrary):

force group = workgroup force create mode = 0770 force directory mode = 0770 force security mode = 0770 force directory security mode = 0770

Samba will then create the *ldb file with rwxrwx--- and be able to remove the locks.

share|improve this answer
client or server? Can you expand on the values someone should try - especially to the uninitiated... – fossfreedom May 21 '11 at 10:28
values? you meant for the mask: those are standard chmod values.I'll add them in :) – Rinzwind May 21 '11 at 10:45
Only problem solved, now the new problem is. When i paste something to my system from another system. The files are locked totally.. – karthick87 May 21 '11 at 15:27
"locked totally" - what do you mean? Can't the files be copied? Are the files copied, but can't you read its contents? – Lekensteyn May 21 '11 at 17:12
@Lekensteyn @khartick87 edited in something about the lockfile. If it doesn't help please comment and I'll check my settings again! – Rinzwind May 21 '11 at 17:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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