LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   I can't write on share samba directory (https://www.linuxquestions.org/questions/linux-software-2/i-can%27t-write-on-share-samba-directory-504707/)

maal 11-25-2006 06:20 AM

I can't write on share samba directory
 
Hi, please help me, i can't write on the share samba directory, insted, i can read it.

os:Fedora core 6 with samba install

[
Quote:

root@maal samba]# rpm -qa | grep samba
samba-client-3.0.23c-2
samba-3.0.23c-2
samba-common-3.0.23c-2
Samba directory
Quote:

drwsrwsrwt 3 pmr480 pmr480 4096 Nov 24 21:59 pmr480
Quote:

[root@maal samba]# smbstatus

Samba version 3.0.23c-2
PID Username Group Machine
-------------------------------------------------------------------
3657 pmr480 pmr480 acer-pzdv2amelz (192.168.2.151)

Service pid machine Connected at
-------------------------------------------------------
pmr480 3657 acer-pzdv2amelz Sat Nov 25 22:33:44 2006

Locked files:
Pid Uid DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
3657 502 DENY_NONE 0x100001 RDONLY NONE /usr/pmr480 . Sat Nov 25 22:33:45 2006
3657 502 DENY_NONE 0x100001 RDONLY NONE /usr/pmr480 . Sat Nov 25 22:33:45 2006

rede : Hub ; 192.168.1.1 Net access; 192.168.2.1/255 intranet
outher os: Win Xp;win 2000, and one win Me
my smb.conf are this on



Quote:

; Options affecting Samba behavior
;
[global]
workgroup = RG
server string = Samba Server
max open files = 5000
load printers = Yes
printcap name = lpstat
printing = sysv
security = user
encrypt passwords = yes
create mask = 0777
directory mask = 0777
;socket options = TCP_NODELAY
dns proxy = no
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

;
[homes]
comment = UNIX Home Directories
path = %H
writeable = Yes
valid users = %S
browseable = No
oplocks = False
level2 oplocks = True
read only = No
;
[printers]
comment = All Printers
path = %H
printable = Yes
browseable = No
guest ok = No
writable = No
printer name = Epson880

;
[pmr480]
path = /usr/pmr480/
public = yes
read only = no
writable = yes
printable = no
locking = yes
#oplocks = False
level2 oplocks = True

zetabill 11-25-2006 11:36 PM

I just set up a samba server today and I ended up having similar problems.

First:
Did you use Fedora's GUI tool or did you manually configure it? Are you having this problem from just your linux machine and are you able to write using the Windows machines? How are you trying to access and write to the share? (I.E. linux command-line, windows explorer, konqueror, nautilus, etc....) What error messages did you get?

This is fresh in my mind from merely hours ago:
On the linux side, the folder that I mounted to with smbmount (you can use mount -t smbfs or mount.smbfs... it's all the same) it had to be done as root and therefore the folder in which the share is mounted became owned by root.root and not username.users. It caused the folder to be read-only for everyone and writable only by root. I passed -o rw,uid=###,gid=### to the mount command to make sure that it was mounted for my username ownerships. You can get those ownerships by doing:
Code:

grep <username> /etc/passwd
and third and fourth fields are your uid and your gid respectively. What also helped for me was that the actual folders on the server that are being shared had permissions of drwxrwx--- (chmod 770).

The other thing you want to do with your level of security is make sure that the usernames match. If the passwords don't then you should be prompted but as long as the usernames match you shouldn't have a problem. Either that or allow for the use of a guest account if a username can't be matched... you haven't set that up so I'm assuming that's not a road you'd like to travel. I only mention it because public = yes is in your share options so it's possible you can see your stuff but you can't write to it because you aren't logged in.
EDIT: Each user needs an account on the server itself which is added to to samba either through the GUI tool or the smbpasswd command.

One thing I just can't help you with is SELinux. Google around or search here for SELinux Samba or something and see if you can trace some symptoms but without knowing any specifics I do know that SELinux can sometimes cause grief if left alone.

If you check out the Samba-3 HOWTO you'll get some fantastic information. What I did was I started here and modified the smb.conf file option by option as I read on and testing the network after each modification. I learned a lot and it works pretty well but I'd recommend some patience and a "can-do" attitude. Take into account that Fedora does things a little differently.

I'm not a Samba guru so without more information I can't help you much more right now. That and I'm quite tired. Good luck and let us know how you make out.

allend 11-26-2006 06:28 AM

The solution is to add fmask=777 to the options in your /etc/fstab for your samba mount.

coolb 11-26-2006 08:24 AM

try chmod'ing or chown'ing the samba share directory...

maal 11-26-2006 08:34 AM

Quote:

Originally Posted by allend
The solution is to add fmask=777 to the options in your /etc/fstab for your samba mount.


It does not modify nothing, customer windows it continues not to have writing permission, reading and only copies
Quote:

# Chmod 777 /etc/fstab
#/etc/init.d/smb restart
been thankful, allend

maal 11-26-2006 08:42 AM

Quote:

Originally Posted by coolb
try chmod'ing or chown'ing the samba share directory...

The directory has permission of reading and writing for owner, group, to outher, as pods to verify below.
Quote:

drwsrwsrwt 3 pmr480 pmr480 4096 Nov 24 21:59 pmr480
Been thankful in the same one

maal 11-26-2006 10:26 AM

it has reading/writing permission
 
new: Share all, it has a directory that it has reading and writing permission meets in /usr/tmp.

maal 11-26-2006 10:29 AM

News
 
news: Share all, it has a directoria that it has reading permission and writing meets in /usr/tmp.

allend 11-27-2006 03:20 AM

I did not mean change the permissions of your /etc/fstab, but rather add the option to the line for yout samba share in /etc/fstab.

maal 11-27-2006 08:15 AM

Quote:

Originally Posted by allend
I did not mean change the permissions of your /etc/fstab, but rather add the option to the line for yout samba share in /etc/fstab.

Allend, can you be more specify.


Thanks in advance

maal 12-18-2006 07:57 AM

Thanks for all your help guys. I am finally up and running.

Solution passed for smb share part of home directoria of user. Instead of /usr/pmr480 - > /home/pmr480/share.

Special thanks to ZetaBill.


All times are GMT -5. The time now is 02:54 PM.