cifsd-team / ksmbd

ksmbd kernel server(SMB/CIFS server)
151 stars 23 forks source link

cannot browse root shares in guest mode #507

Closed erdoukki closed 3 years ago

erdoukki commented 3 years ago

cannot browse root shares in guest mode in 3.3.7, but I can access if a specify the share mount point...

namjaejeon commented 3 years ago

Can you give us how to reproduce ? What client do you use to reproduce ? and please share contents in smb.conf.

erdoukki commented 3 years ago

Server side : OpenWrt SNAPSHOTS on MVEBU (EspressoBin Board)

root@LS421DE:~# cat /etc/ksmbd/smb.conf
[global]
    netbios name = LS421DE
    server string = Ksmbd on OpenWrt
    workgroup = WORKGROUP
    interfaces = eth0 
    bind interfaces only = yes
    ipc timeout = 20
    deadtime = 15
    map to guest = Bad User
    smb2 max read = 64K
    smb2 max write = 64K
    smb2 max trans = 64K
    cache read buffers = no
    cache trans buffers = no

######### Dynamic written config options #########

[LS421DE-1]
    path = /mnt/sda1
    force user = root
    force group = root
    create mask = 0666
    directory mask = 0777
    read only = no
    guest ok = yes
    inherit owner = yes
    hide dot files = no

[LS421DE-2]
    path = /mnt/sdb1
    force user = root
    force group = root
    create mask = 0666
    directory mask = 0777
    read only = no
    guest ok = yes
    inherit owner = yes
    hide dot files = no
root@LS421DE:~# 

Clients side : Apple iPhone and iPad with or Linux Ubuntu Desktop

Same problems with an error message about bad authentication or an authentication dialog shown.

Mounting or accessing directly the shares works fine, without authentication dialog, or with guest success

eximido commented 3 years ago

Same on both Windows 10 and Windows 7 - it always shows an authentication dialog without any ability to skip it. There are also some people on OpenWrt community forum complaining about this issue.

The last version with fully working guest mode was 3.3.4.

mmakassikis commented 3 years ago

This seems to be the same issue that was reported on the mailing list: https://sourceforge.net/p/linux-cifsd/mailman/message/37250971/

Can you add the following config in smb.conf and test again ?

[IPC$]
    guest ok = yes
erdoukki commented 3 years ago

[IPC$] guest ok = yes

WORKS ! thanks...

modifying, on openwrt, the template and restart ksmbd service : root@LS421DE:~# cat /etc/ksmbd/smb.conf.template

[global]
    netbios name = |NAME|
    server string = |DESCRIPTION|
    workgroup = |WORKGROUP|
    interfaces = |INTERFACES|
    bind interfaces only = yes
    ipc timeout = 20
    deadtime = 15
    map to guest = Bad User
    smb2 max read = 64K
    smb2 max write = 64K
    smb2 max trans = 64K
    cache read buffers = no
    cache trans buffers = no
[IPC$]
    guest ok = yes

service ksmbd restart

Share are available without any dialog for authentication... Test from ubuntu

thanks

erdoukki commented 3 years ago

confirmed to work fine also for browsing shares as guest (without authentication) from FileExplorer on iPhone !

erdoukki commented 3 years ago

in 21.02-rc3, problem back again (ksmbd 3.3.9)

erdoukki commented 3 years ago

problem disappear just by changing sharename (I was using the hostname as sharename)...