aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

samba allow write all users

Fri Jun 01, 2018 5:35 pm

I want to configure samba on my raspberry pi, to create a shared folder writable by everyone.

Everyone means, I won't create samba users on Raspbian, and any user from any Windows machine will be able to write in this folder.

I tried multiple options in /etc/samba/smb.conf. I can make the shared folder accessible, but not writable.

Code: Select all

[public]
path = /media
public = yes
writable = yes
guest ok = yes
available = yes
browsable = yes
create mask = 777
directory mask = 777
force user = nobody
force group = nogroup
directory mask = 0770
directory security mask = 0770
force directory mode = 0770
force directory security mode = 0770
How can I do this?

fred44nl
Posts: 292
Joined: Sat Jun 25, 2016 11:59 am
Location: Scharendijke, NL

Re: samba allow write all users

Fri Jun 01, 2018 5:55 pm

I have an entry saying:
read only = no
may be it helps, not sure :)

this is from internet "somewhere":
# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
; path = /usr/somewhere/else/public
; public = yes
; only guest = yes
; writable = yes
; printable = no
source: http://www.labtestproject.com/samba_ser ... e_smb.conf
headless RPi 3B running from usbhdd.

mikerr
Posts: 2825
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: samba allow write all users

Fri Jun 01, 2018 7:01 pm

You need far less than that:

Code: Select all

[Home]
path = /home/pi
read only = no
guest ok = yes
Then also

Code: Select all

sudo chmod a+w /home/pi 
Insecure, anyone can read/write - but gets the job done.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

aristosv
Posts: 159
Joined: Mon Dec 08, 2014 7:47 pm

Re: samba allow write all users

Sat Jun 02, 2018 2:56 am

this worked
[Shared]
path = /media
read only = no
guest ok = yes
But now the local users of the pi can't write in the folders created under /media

snakepit
Posts: 9
Joined: Tue Jun 05, 2018 7:31 pm

Re: samba allow write all users

Tue Jun 05, 2018 7:58 pm

If you want local pi users to also right into /media without opening the directory to 777. Then create a new group, ex mediausers

Add all pi users to mediausers group in /etc/group.

Code: Select all

usermod <user> -G mediausers
Change group ownership on /media to mediausers

Code: Select all

chgrp /media
Change permissions so members of the new group can write to the directory.

Code: Select all

chmod g+w /media
Update /etc/samba/smb.conf
to force group mediausers instead of nobody.

Return to “General discussion”