[TriLUG] Samba on a RPi

Matthew Glassman via TriLUG trilug at trilug.org
Sun Sep 6 18:50:50 EDT 2020


Hello folks,

I have what I'm sure is a simple question and answer, but I may be
overthinking it.  I have a Raspberry Pi running Pi OS (formerly
Raspian) and have installed Samba on it.  I have an external USB Hard
Drive that I want to use as a remote storage device.

I have hooked up the USB drive, formatted it with an NTFS system, and
created a mount point on the raspberry Pi.

I have created shares in Samba (one for myself and one for my wife)
and created the required share folder location (in relation to the
path designated in smb.conf).  I can mount the samba share with my
samba credentials.  The issue I have is that everything on the mounted
share is designated as root as user and group.  I can't chmod my own
folder that I created even with a sudo issuance.   So is this
happening at the mounting of the share (which I believe it is)?  If
so, can I still mount the hard drive and still have it give  my perms
and ownership for my share and my wife's perms and ownership for her
share?

So in short..
1. External drive /dev/sda1 is mounted to raspberry Pi at /media/external
2. /media/external has samba shares /media/external/myshare and
/media/external/hershare
3. I want to be able to have myshare have me as owner and samba group
as group and similar for my wife's share.  Currently everything is
root:root 777.

Regards,
Matthew


More information about the TriLUG mailing list