LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   no write access to subfolders of samba share (https://www.linuxquestions.org/questions/linux-server-73/no-write-access-to-subfolders-of-samba-share-773392/)

roozbeh 12-04-2009 01:43 AM

no write access to subfolders of samba share
 
Hi.

I am using samba t share my files.I am sharing /media/MEDIA folder. it is a ntfs partition mounted with ntfs-3g with write/read access from linux.

I can see and browse my shares and also create files in the root of this partition, ie /media/MEDIA, but in its subfolders i do not have write permissions.

here is my samba.conf
Code:

#======================= Global Settings =======================
[global]
        log file = /var/log/samba/log.%m
        passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\successfully* .
        obey pam restrictions = yes
        sync always = yes
        username map = /etc/samba/smbusers
        null passwords = yes
        map to guest = Bad User
        encrypt passwords = true
        show add printer wizard = no
        public = yes
        passwd program = /usr/bin/passwd %u
        wins support = true
        netbios name = roozbeh-mint
        inherit permissions = yes
        writeable = yes
        server string = %h Server
        default = global
        workgroup = WORKGROUP
        os level = 20
        auto services = global DriveD
        security = share
        syslog = 0
        panic action = /usr/share/samba/panic-action %d
        max log size = 1000

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of

# server string is the equivalent of the NT Description field


#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects

# Put a capping on the size of the log files (in Kb).

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.

# Do something sensible when Samba crashes: mail the admin a backtrace

####### Authentication #######

;        passdb backend = tdbsam

;        guest account = nobody

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).

############ Misc ############

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
;        socket options = tcp_nodelay

#======================= Share Definitions =======================

[DriveD]
        path = /media/MEDIA

also by default computer name is not shown in windows xp, i have to type its name or address to browse to it.

another interesting thing is that i have permission to create directory and delete files everywhere and in any folder, subfolder but when trying to create files i get not enough free disk space error.

any clues?

by the way i dont know if this config file is correct, i find as template in internet.

tnx

irishbitte 12-04-2009 08:18 PM

well, i'm wondering is there a reason that you are using an NTFS partition for this? Samba can work just as easily with ext3?

roozbeh 12-05-2009 03:24 AM

Well. I just moved from windows to linux, so all my datas are in ntfs partitions.
And i want to share them with my network and also my virtual machine with windows xp guest.

And as i still require somethimes to boot into my xp machine, converting ntfs partitions into ext3/ext4 are not a solution for me.


PS. so does this mean my shares look ok?

thanks.

irishbitte 12-06-2009 07:57 PM

Hmm, your SAMBA file is a little heavy on the global definitions, and light on the share. I'm interested to know who would be allowed access to your share, since no-one is listed?

irishbitte 12-06-2009 08:01 PM

Code:

[docs-dave-laptop]
        path = /home/dave/Documents
        writeable = yes
;        browseable = yes
        valid users = dave

[dave-pics]
        path = /home/dave/Pictures
;        writeable = no
;        browseable = yes
        valid users = dave

This is a snippet from my smb.conf, hope it might help you along.

roozbeh 12-07-2009 09:31 AM

thank you.
maybe the reason for my globals being this much is that i wanted to allow every user have access to my shares.

i will try with yours and see what happens

is there anyway i can find why samba rejected to copy files? ie any log files?


the intresting thing is that i can copy small size files, like under 1kb but no more than that.
also copying other files always give me not enough disk space error in windows. so it seems samba wrongly think disk space is limited.

Sum1 12-07-2009 03:54 PM

Quote:

Originally Posted by roozbeh (Post 3782794)
thank you.
i wanted to allow every user have access to my shares.

If you really want to insure all samba users have read/write access, you can su to root and do ~$chmod -R 0777 /media/MEDIA

and the put the following into your [DriveD] parameters:

create mask = 0777
directory mask = 0777
security mask = 0777
directory security mask = 0777


Everyone can certainly jump in the pool to read write and execute once this is set.

HTH

kschmitt 12-07-2009 04:20 PM

In big multi-user shares it's useful to use the force group option. Otherwise directories created by a user will default to their default group*. Here's a quick example for users in a PICTURES group. To get access to the share users would have to be in the PICTURES group, and any files they wrote or saved would default to being owned by that group. The create mask and directory mask take care of the rest (as suggested above), ensuring everyone in that group has access to read & write the files. The execute bit is setup because samba likes it**.

[PICTURES]
comment = Company Pictures
path = /export/PICTURES
valid users = @PICTURES
public = no
force group = PICTURES
writable = yes
create mask = 0770
directory mask = 2770



*Blatant oversimplification.
**Blatant oversimplification. Look at the samba docs about unix to windows permissions if you really want to know.

irishbitte 12-08-2009 07:35 PM

Hi again Roozbeh, I hope you got some good info from the other posts here. For me, if I was starting with a samba server like this, the first thing I would do is leave the global settings at default and slowly add features. The simplest way to allow everyone access to a share is to use
Code:

security = share
however, maybe some of the other things you have put in are working against that because they are meant for a more secure setup, for example
Code:

map to guest = Bad User
Anyhow, that is what I would do.

BTW, you have specified in the first line of your global section where your log file is,
Quote:

log file = /var/log/samba/log.%m
which I think you are looking for? Also, the disk space error happens on mapped shares when samba stops a copy happening, it is windows interpretation of bad permissions from samba.


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