Why can I not write to a SAMBA share when read/write is enabled?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216
Rep:
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:
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216
Rep:
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>).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.