Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use Samba to share printers, files, etc. But I have a problem. The place to share not writable. Writable is only user directory. I attach the smb.conf file.

smb.conf

#
# Smb.conf file by PepinCZ on HOME-SERVER 192.168.1.13 
#

#======================= Global Settings =======================

[global]
   workgroup = WORKGROUP
   server string = %h
   netbios name = HOME-SERVER
   security = user
   dns proxy = no
;  name resolve order = lmhosts host wins bcast

#### Networking ####

;   interfaces = 127.0.0.0/8 eth0
;   bind interfaces only = yes



#### Debugging/Accounting ####

   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d


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

   encrypt passwords = true 
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully*
   pam password change = yes
   map to guest = bad user

########## Domains ###########

   domain logons = yes
;   logon path = \\%N\profiles\%U)
;   logon drive = H:
#   logon home = \\%N\%U
;   logon script = logon.cmd
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
; add group script = /usr/sbin/addgroup --force-badname %g

########## Printing ##########

#   load printers = yes
;   printing = bsd
;   printcap name = /etc/printcap
;   printing = cups
;   printcap name = cups

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

;   include = /home/samba/etc/smb.conf.%m
#         SO_RCVBUF=8192 SO_SNDBUF=8192
#   socket options = TCP_NODELAY
;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
#   domain master = auto
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash
;   winbind enum groups = yes
;   winbind enum users = yes
   usershare max shares = 100
   usershare allow guests = yes

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

[homes]
   comment = Složka uživatele %u
   browseable = no
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S

[profiles]
   comment = Uživatelské účty
   path = /home/samba/profiles
   guest ok = no
   browseable = yes
   read only = no
   create mask = 0600
   directory mask = 0700

[printers]
   comment = Tiskárny
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Ovladače k tiskárnám
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
;   write list = root, @lpadmin

[Web Server]
   comment = Web Server
   path = /var/www
   browseable = yes
   guest ok = no
   read only = no
   public = yes
   write list = root, user, pepincz

[Server System]
   comment = Systém serveru HOME-SERVER
   path = /
   browseable = yes
   guest ok = no
   read only = yes

[Disk]
   comment = Úložný prostor
   path = /share
   browseable = yes 
   guest ok = no
   read only = no
   public = yes
   write list = root, user, pepincz, tata, lucka

getfacl /share:

getfacl: Removing leading '/' from absolute path names
# file: share
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

ls -l /share:

0 

Please help me. I do not know why it does not work. Thank you guys!

share|improve this question
    
What are we talking about, /share? If so: What is the output of ls -l /share and getfacl /share? Add this information to your question. –  Hauke Laging Jun 21 at 17:20
    
@HaukeLaging: OK, posted, thanks. –  PepinCZ Jun 21 at 17:31

1 Answer 1

up vote 0 down vote accepted

The /share share is not writable (except for root) because the directory /share is not writable for the other users. The write list option affects the SMB level only, it does not influence the file system permissions. In order to write both Samba and the file system must allow write access.

You may create a group for these users and give the directory to the group:

chgrp writegroup /share
chmod g+w /share

Alternatively you can use ACLs to allow access for the single users:

setfacl -m u:userrwx,u:pepincz:rwx,u:tata:rwx,u:lucka:rwx /share
share|improve this answer
    
It can not be done to make it automatic? –  PepinCZ Jun 21 at 19:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.