LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Why can I not write to a SAMBA share when read/write is enabled? (http://www.linuxquestions.org/questions/linux-general-1/why-can-i-not-write-to-a-samba-share-when-read-write-is-enabled-475630/)

eric m 08-20-2006 11:24 AM

Why can I not write to a SAMBA share when read/write is enabled?
 
OK, first off, I'm pretty ignorant about Linux, so I may be missing something totally stupid.

Anyway, I've created a SAMBA share on the Linux box using its GUI. I've set access to everyone and set it to read/write. I can connect just fine, but I can't write to the share from a Windows machine.

The thing that's really irritating is that I was able to make it work yesterday. Today, I could still access the old share, read and write to it AFTER I deleted its entry in the SAMBA GUI!

So, what should I be doing? What am I not doing?

I appreciate any and all advice.

Thanks!

centauricw 08-20-2006 10:59 PM

Samba doesn't override the Linux file permissions. If the user doesn't have permission to write to the directory from a shell account, they can't do it through Samba regardless of the configuration. You might also find these options useful:

create mask = 664
directory mask = 775
force group = mysambausers

Then fix the file permissions on the directory tree and make all the files owned by the mysambausers group (you can name this group whatever you like). The "create mask" and "directory mask" will keep the Linux file permissions in order and "force group" will cause the access to use mysambausers as the group, keeping ownership straight. You can correct the file permissions and group ownership with this code executed from the top of the directory tree you want to share via Samba:

find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod 664 {} \;
chgrp -R mysambausers *

Cheers.

eric m 08-21-2006 11:28 AM

Thanks for helping!

(pause while waiting for flames)

OK, are these lines to be added to the Samba configuration? :

create mask = 664
directory mask = 775
force group = mysambausers

Is the second batch of code something I run in the terminal, or does it get added to a file somewhere?

How do I fix file permissions? I guess that's what the code does? And how do I "execute from the top of the directory tree?"

Yes, I'm ignorant. "Newbie" is probably too kind.

eric m 08-21-2006 12:08 PM

Well, I beat the file permissions part, I think. I have to create a user account for everyone who wants to use that directoty, correct?

centauricw 08-21-2006 09:22 PM

Quote:

OK, are these lines to be added to the Samba configuration? :

create mask = 664
directory mask = 775
force group = mysambausers
Yup. You can put the first two in the Globals section if you want these permissions to apply to all file shares. Put the "force group" in the section for each file share.

Quote:

Is the second batch of code something I run in the terminal, or does it get added to a file somewhere?
You run this found the terminal. CD to the top of the directory you are sharing and then run each line to fix the file permissions and ownership. (From a Linux terminal session, it's kind of like using a DOS session in Windows.)

Quote:

I have to create a user account for everyone who wants to use that directoty, correct?
If you want to have separate user accounts. You could also have them access the Samba shares using the same user account, but you do need to create a user account. And you will need to add them to the Samba password file using the "smbpasswd" command (specifically, "smbpasswd -a <username>).

Hope this helps.


All times are GMT -5. The time now is 07:41 AM.