-- Leo's gemini proxy

-- Connecting to nuacht.flounder.online:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

samba


This creates our household share that doesn't require login. Risky, but in our case all data stored here are unconfidential duplicate midea that we can afford to lose but would like easy shared access to.


apt install samba samba-common-bin

nano /etc/samba/smb.conf

[Share]
path = /home/pi/share
browseable = yes
writable = yes
read only = no
force user = nobody
guest ok = yes
directory mask = 0777
create mask = 0777

then


service smbd restart
(or)
sudo systemctl restart smbd

Also,

chmod 777 /home/pi/share

to allow guests to have write permissions. Check existing permissions with

stat -c '%a' /home/pi/share

This is wide open to anyone in the network to read and write to. In our case, it just hosts duplicates of family media for quick access on the projector laptop.


For more serious use, create restricted shares, masks and users in the .conf file.

For more info on create and directory mask see http://www.bodenzord.com/archives/53


Adding users

(Almost forgot).

sudo adduser joe

sudo smbpasswd -a joe



Update

The chmod 777 trick was required not only to allow guests, but for some reason even registered users. This is not good security so instead here is a suggestion found online and written by

yaegashi


I recommend to create a dedicated user for that share and specify it in force user(see docs).


Create a user (shareuser for example) and set the owner of everything in the share folder to that user:


adduser --system shareuser

chown -R shareuser /path/to/share

Then add force user and permission mask settings in smb.conf:


[myshare]

path = /path/to/share

writeable = yes

browseable = yes

public = yes

create mask = 0644

directory mask = 0755

force user = shareuser

Note that guest ok is a synonym for public.


//end of update / footnote

-- Response ended

-- Page fetched on Tue May 21 14:05:09 2024