A
A
Anton Pavlov2014-07-01 12:06:13
linux
Anton Pavlov, 2014-07-01 12:06:13

Why won't Samba on Debian 7 let me write files to a directory?

35a59c1dc01a47e5a91e893ae7a55a66.PNGStraight to the point.
I'm raising FTP on debian 7, so samba is needed so that people can upload files to folders, and ftp is needed so that other users "from far away" can pick up these files. Well, of course the other way around. I started with setting up samba, I just started to figure it out in Linux, so explain it like for a teapot.
I am attaching the smb.conf file.
PS the local network uses a domain

[global]

workgroup = WORKGROUP
server string = %h server
dns proxy = no

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

security = share
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

[homes]
comment = Home Directories
browseable = no
read only = yes
create mask = 0700
directory mask = 0700
valid users = %S

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

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

[MediaContent]
path = /media/ftp-data/MediaContent
read only = no
guest ok = yes
browsable = yes 
create mask = 0600 
directory mask = 0700

[ZakirovDR]
path = /media/ftp-data/ZakirovDR
read only = no
guest ok = yes

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Salavat Sharapov, 2014-07-01
@desperadik

[MediaContent]
path=/media/ftp-data/MediaContent
read only=no
writable=yes
guest ok=yes
create mask=0777
directory mask=0777

S
Sergey Petrikov, 2014-07-01
@RicoX

An example of a working config with comments
[global]
; General server settings
; Имя компа, как будет видно в сетевом окружении
netbios name = nas
server string = My personal NAS
; Рабочая группа клиентов
workgroup = WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
passdb backend = tdbsam
security = user
null passwords = true
; Файл для альясов имен юзеров
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
wins support = yes
; Логи
log file = /var/log/samba/log.%m
syslog = 0
syslog only = no
дальше свои дирректории
after that you need to create a password for samba users
smbpasswd -a user_name
and enable it
smbpasswd -e user_name then
we can connect from his name to the server to make name matching, you can configure
/etc/samba/smbusers
format something like this
user_name = alias1 alias2
Don't forget check that the users from whom you come in via smb have the rights to write to the specified directories.

V
Vlad Zhivotnev, 2014-07-01
@inkvizitor68sl

Check that the user who comes to samba has the right to write to the correct directory.
https://ru.wikipedia.org/wiki/Chown
https://ru.wikipedia.org/wiki/Chmod

N
Nikolay Shamanovich, 2014-07-01
@Shm13

chmod -R 777 <shared folder> - clumsy method

K
Konstantin, 2014-07-02
@fallen8rwtf

Is the user being authenticated? I configured through AD, otherwise I asked for a login password.
And yet, added to the configs the ball
valid users = "@DOMAIN/USER"
or to prohibit
invalid users = "@DOMAIN/USER"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question