LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 08-20-2006, 11:24 AM   #1
eric m
LQ Newbie
 
Registered: Aug 2006
Distribution: Red Hat
Posts: 10

Rep: Reputation: 0
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!
 
Old 08-20-2006, 10:59 PM   #2
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
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.
 
Old 08-21-2006, 11:28 AM   #3
eric m
LQ Newbie
 
Registered: Aug 2006
Distribution: Red Hat
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 08-21-2006, 12:08 PM   #4
eric m
LQ Newbie
 
Registered: Aug 2006
Distribution: Red Hat
Posts: 10

Original Poster
Rep: Reputation: 0
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?
 
Old 08-21-2006, 09:22 PM   #5
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
share read and write permission to users suguname Mandriva 3 01-18-2005 12:53 AM
Example share in smb.conf doesn't work - read/write vs read only kleptophobiac Linux - Networking 0 09-01-2004 07:14 PM
I want my linux machine to read/write to an XP share bjs Linux - Newbie 8 03-26-2004 03:56 PM
A share that users can see, read and write to....without password fatboyal Linux - Newbie 11 01-16-2004 08:56 PM
Open office read only, K-write read/write mode lwtvh Linux - Newbie 1 07-19-2003 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration