Samba share

Debian-based Distributions

Debian

There is currently no package for wsdd in the official Debian repositories. However, wsdd is considered to be part of the next Debian release, Bookworm, which in the testing phase. A wsdd package is also available in unstable.

To install wsdd under Bullseye and earlier see the “Others” section below.

Others

There are user-maintained packages for which you need to add the repository to the apt repo list and download the according GPG public key:

wget -O- https://pkg.ltec.ch/public/conf/ltec-ag.gpg.key | gpg --dearmour > /usr/share/keyrings/wsdd.gpg
source /etc/os-release
echo "deb [signed-by=/usr/share/keyrings/wsdd.gpg] https://pkg.ltec.ch/public/ ${UBUNTU_CODENAME:-${VERSION_CODENAME:-UNKNOWN}} main" > /etc/apt/sources.list.d/wsdd.list

Note that the repository only provides packages for Debian and Ubuntu LTS releases up to Buster and Focal Fossa (20.04), respectively. The wsdd.list file created by the command above should be checked to refer to an appropriate distro code name.

After the GPG public key file and repository have been created, install wsdd via:

apt update
apt install wsdd
1 Like

My DietPi is now accessable browsing via my network
I can browse (Nextcloud) folders like Music, Pictures, Videos

But folders like

\\DIETPI\dietpi\downloads
\\DIETPI\dietpi\nzbget\nzb

mention ‘access denied’ creating a new file

My smb.conf looks like this

[global]

        workgroup = WORKGROUP
        server string = %h server
        dns proxy = no
        log file = /var/log/samba/log.%m
        max log size = 1000
        syslog only = no
        syslog = 0

        panic action = /usr/share/samba/panic-action %d

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

        load printers = no
        printcap name = /dev/null
        disable spoolss = yes

[dietpi]
        comment = DietPi Share
        path = /mnt/dietpi_userdata
        browseable = yes
        create mask = 0664
        directory mask = 0775
        valid users = dietpi
        writeable = yes
        max connections = 12

What to add to read and write in these folders?

You need a section where you publish your two folders.
The [dietpi] section should give you some hints about this. You could copy it for your needs.
See also e.g. there: smb.conf

it’s not directly an issue of SMB configuration. More a question on file system permissions on OS level. You login as user dietpi, means this user need to have access to the files/folders in question. Simply check the directory

ls -la /mnt/dietpi_userdata
root@DietPi:/etc/samba# ls -la /mnt/dietpi_userdata
lrwxrwxrwx 1 root root 57 Jan  5 15:39 /mnt/dietpi_userdata -> /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata
root@DietPi:/etc/samba#

Ok it’s moved to a different drive. Can you share following

ls -la /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata
lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
root@DietPi:/# ls -la /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata
total 40
drwxrwxrwx+ 9 dietpi   dietpi   4096 Jan  3 12:49 .
drwxr-xr-x  5 root     root     4096 Dec 29 11:13 ..
drwxrwxr-x  2 dietpi   dietpi   4096 Jan  6 12:46 Music
drwxrwxr-x  2 dietpi   dietpi   4096 Jan  6 12:49 Pictures
drwxrwxr-x  2 dietpi   dietpi   4096 Dec 29 11:02 Video
drwxrwxr-x  5 dietpi   dietpi   4096 Dec 29 11:02 downloads
drwxr-xr-x  5 mysql    mysql    4096 Jan  6 12:27 mysql
drwxrwx---  7 www-data www-data 4096 Jan  3 12:55 nextcloud_data
drwxr-xr-x  5 nzbget   root     4096 Jan  6 11:06 nzbget
root@DietPi:/# lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
NAME         FSTYPE LABEL  SIZE RO TYPE MOUNTPOINT                           PARTUUID                             UUID
sda                        4.5T  0 disk
└─sda1       ext4          4.5T  0 part /mnt/c2464ab4-6613-435f-98ba-79bec89 35b84818-f6f3-40ab-b2b6-025b3728c707 c2464ab4-6613-435f-98ba-79bec89379de
mtdblock0                   16M  0 disk
mmcblk2                   14.5G  0 disk
└─mmcblk2p1  ext4         14.4G  0 part /                                    3ef8e130-01                          f635d25f-07db-4d13-8542-b95e55143b30
mmcblk2boot0                 4M  1 disk
mmcblk2boot1                 4M  1 disk
root@DietPi:/#

folder downloads should be writable via Samba user dietpi as the folder is owned by same user/group

This folder is writable by user nzbget only. You would need to change group ownership to group dietpi and add write permission for the group.

thx, but inside the default folder ‘downloads\nzb’ no files can be added?

Is it wise to use

valid users = # No valid users list (anyone can login)

As the share is only available in the home network?

can you share content of /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/downloads/

root@DietPi:~# /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/downloads/
-bash: /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/downloads/: Is a directory
root@DietPi:~#

you need to add the command to show the content. Just entering the directory name into CLI will not work

ls -la /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/downloads/

:smiling_face:

root@DietPi:~# ls -la /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/downloads/
total 40
drwxrwxr-x  8 dietpi dietpi 4096 Jan  8 15:03 .
drwxrwxrwx+ 9 dietpi dietpi 4096 Jan  3 12:49 ..
drwxrwxr-x  2 dietpi dietpi 4096 Jan  8 15:02 complete
drwxrwxr-x  2 dietpi dietpi 4096 Jan  8 15:02 incomplete
drwxrwxr-x  2 dietpi dietpi 4096 Jan  8 15:03 intermediate
drwxr-xr-x  2 nzbget dietpi 4096 Dec 29 11:24 nzb
-rw-r-----  1 nzbget dietpi    4 Jan  8 14:45 nzbget.lock
drwxr-xr-x  2 nzbget dietpi 4096 Dec 29 11:24 queue
drwxr-xr-x  2 nzbget dietpi 4096 Jan  6 11:05 tmp
root@DietPi:~#

folders are writable for user nzbget only. You would need to ad write permission for group dietpi as well, to be able to allow access via SMB.

like

chmod 775 /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/nzbget
chmod 775 /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/downloads

?

can the rights of the NZBGet folder(s) be changed so its standard useable after installing NZBGet?

Permissions for these folders is correct already. Your problem are the 3 folders inside

drwxr-xr-x  2 nzbget dietpi 4096 Dec 29 11:24 nzb
drwxr-xr-x  2 nzbget dietpi 4096 Dec 29 11:24 queue
drwxr-xr-x  2 nzbget dietpi 4096 Jan  6 11:05 tmp

Theoretically you could do

chmod 775 -R /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/downloads/

This will add group write permission for all sub folder inside dietpi_userdata/downloads/

This folder is different. Actually it is owned by user nzbget and group root

Means you would need to change group ownership in addition.

this doesn’t make sense in my opinion as an end-user
you want the ‘nzbget’ folder available in your network
but it get’s another owner / user outside ‘dietpi’ so standard not usable with the ‘dietpi’ user account

is the solution something like

invalid users = root, nzbget

?

Because of this you own it to user nzbget and the group dietpi, (dietpi user is also part of the group dietpi) so both users (nzbget and dietpi) can use it.
sudo chown nzbget:dietpi -R /mnt/c2464ab4-6613-435f-98ba-79bec89379de/dietpi_userdata/nzbget

And if you gave 755 to it, everybody can read from that directory.