Page 1 of 3

samba server sharing issue

Posted: Fri Dec 13, 2019 10:36 am
by dron
Hi,

i have installed the samba server in a raspberry 3 but I cannot connect to the server from any device (android mobile, android tv).
in the config file i have also added an external disk.
the samba clients in android can connect and see both shared directories but when i access them (login: root/dietpi or dietpi/dietpi), i get "Access denied".
I uninstalled/reinstalled samba, I forced SMB3 ( sudo sed -i "/\\[global\\]/a client min protocol = SMB3" /etc/samba/smb.conf ) but the issue remains.

any advice?


[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 = 0775
directory mask = 0775
valid users = dietpi
writeable = yes
max connections = 8


[storage]
comment = USB HDD
path = /mnt/76D062D4D0629A5F/dietpi_userdata
browseable = yes
create mask = 0775
directory mask = 0775
valid users = root
public = no
writeable = yes

Re: samba server sharing issue

Posted: Fri Dec 13, 2019 11:26 am
by Joulinar
Hi,

short question. Is "dietpi" still the standard password you are using to login via ssh? Or did you changed it during initial setup? If it was changed, pls try that one. At least for me it is User= dietpi and my own PW. not that standard one.

Re: samba server sharing issue

Posted: Fri Dec 13, 2019 11:32 am
by dron
hi, i did not modify anything.
default usernames and passwords.
root/dietpi seems to be the default login in my case even the dietpi version is 6.26.3.

Re: samba server sharing issue

Posted: Fri Dec 13, 2019 12:28 pm
by Joulinar
Hi,

try to setup SAMBA without any modification first. Just to check if it's working or not

How to manage/access is described here

I just checked it and I was able to access from my Windows10 computer without issues right after installation.

Re: samba server sharing issue

Posted: Fri Dec 13, 2019 1:23 pm
by dron
I tried with the default settings initially.
due to my userdata is located in the external usb disk, i added the last lines.
i will try later from my win10 laptop .


[storage]
comment = USB HDD
path = /mnt/76D062D4D0629A5F/dietpi_userdata
browseable = yes
create mask = 0775
directory mask = 0775
valid users = root
public = no
writeable = yes

Re: samba server sharing issue

Posted: Sat Dec 14, 2019 11:08 am
by Joulinar
Maybe for testing purposes you should go back to standard. Just to verify the access in general.

Re: samba server sharing issue

Posted: Sat Dec 14, 2019 12:37 pm
by MichaIng
Note that the dietpi install only creates a Samba password for dietpi user. Since you added the share with valid user = root you need to create a Samba password for it: smbpasswd -a root

And another thing is that userdata on external drive should actually not be a problem. The default location is symlinked to the external drive, hence still valid, as long as AppArmor or SELinux rules do not break symlinked access for Samba, when active.

Re: samba server sharing issue

Posted: Sat Dec 14, 2019 2:59 pm
by dron
i removed the last lines, i restarted samba process but i still cannot view my shared folder from my laptop/android phone.

[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 = 0775
directory mask = 0775
valid users = dietpi
writeable = yes
max connections = 8
Image 2.png
Image 2.png (3.46 KiB) Viewed 3060 times
dietpi_not_accessible.png

Re: samba server sharing issue

Posted: Sat Dec 14, 2019 3:34 pm
by MichaIng
Please assure that the /mnt/dietpi_userdata/ content that you want to share is owned by the dietpi user, respectively it has R/W permissions. I'm not sure how the Windows SMB client handles user/password entry, but it requires user dietpi and the global software password that you assigned on first login, "dietpi" by default.

You could also try it on a different dir and adjust the samba config accordingly, to test if there is really an access issue to the external drive somehow.

Re: samba server sharing issue

Posted: Sat Dec 14, 2019 3:51 pm
by dron
i see that the userdata dir has root/root rights.

root@DietPi:/mnt# ls -ltr
total 28
drwxr-xr-x 2 root root 0 Feb 14 2019 b819bea4-0b7f-4903-9669-244b0f5d6720
drwxr-xr-x 2 root root 4096 Jul 14 20:24 nfs_client
drwxr-xr-x 2 root root 4096 Jul 14 20:24 ftp_client
lrwxrwxrwx 1 root root 37 Nov 24 16:44 dietpi_userdata -> /mnt/76D062D4D0629A5F/dietpi_userdata
drwxrwxrwx 1 root root 20480 Nov 24 21:49 76D062D4D0629A5F
root@DietPi:/mnt#


Edit: internal dir(/opt/Radarr) seems to work ok! I can see its files in smb client in android.

any ideas for the external /mnt directory?