samba server sharing issue

Having issues with your DietPi installation, or, found a bug? Post it here.
dron
Posts: 11
Joined: Fri Dec 13, 2019 10:02 am

samba server sharing issue

Post 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
User avatar
Joulinar
Posts: 2588
Joined: Sat Nov 16, 2019 12:49 am

Re: samba server sharing issue

Post 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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
dron
Posts: 11
Joined: Fri Dec 13, 2019 10:02 am

Re: samba server sharing issue

Post 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.
User avatar
Joulinar
Posts: 2588
Joined: Sat Nov 16, 2019 12:49 am

Re: samba server sharing issue

Post 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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
dron
Posts: 11
Joined: Fri Dec 13, 2019 10:02 am

Re: samba server sharing issue

Post 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
User avatar
Joulinar
Posts: 2588
Joined: Sat Nov 16, 2019 12:49 am

Re: samba server sharing issue

Post by Joulinar »

Maybe for testing purposes you should go back to standard. Just to verify the access in general.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: samba server sharing issue

Post 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.
dron
Posts: 11
Joined: Fri Dec 13, 2019 10:02 am

Re: samba server sharing issue

Post 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 2599 times
dietpi_not_accessible.png
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: samba server sharing issue

Post 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.
dron
Posts: 11
Joined: Fri Dec 13, 2019 10:02 am

Re: samba server sharing issue

Post 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?
Last edited by dron on Sat Dec 14, 2019 4:07 pm, edited 1 time in total.
Post Reply