IceWhaleTech / CasaOS

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
https://casaos.io
Apache License 2.0
25.82k stars 1.41k forks source link

[Bug] Cannot access samba shared folders on linux machines #1385

Closed nmendiboure closed 1 year ago

nmendiboure commented 1 year ago

Hi,

I recently installed casaos 0.4.4-1 on a debian 11 raspbian base (pi4), and I met issues when I want to access shared folders from another linux machine (linux mint 21.2).

I set a folder called "Media" and located on my external NAS ssd as "shared" by using the file browser feature of casaos.

Capture d’écran du 2023-09-06 22-32-07

Then when I go into my "network" section on my computer, the name of my pi nas (picolas) appears, but I can't access my shared folder. The nas also appears in the windows workgroup list, still cannot be accessed.

Capture d’écran du 2023-09-06 22-33-35 When I run the command smbclient -L //192.168.1.26 I got this :

Capture d’écran du 2023-09-06 22-32-55

On my windows VM I manage to access the folder, but not on linux. I also tried to add that lines on both server and client machines (/etc/samba/smb.casaos.conf and /etc/samba/smb.conf):

workgroup = WORKGROUP client min protocol = NT1 server min protocol = NT1

after reboot, nothing changed.

However, I found it was possible to mount it using that command :

sudo mount -t cifs -o username=$USER //192.168.1.26/Media /path-to-mount-point

I'd like to know how can I access my shared folders directly from workgroup list ?

Thanks in advance

System Time

               Local time: Wed 2023-09-06 22:46:16 CEST
           Universal time: Wed 2023-09-06 20:46:16 UTC
                 RTC time: n/a
                Time zone: Europe/Paris (CEST, +0200)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
LinkLeong commented 1 year ago

https://pq.hosting/en/help/windows/448-oshibka-ubuntu-ne-vidit-set-samba.html image I tested it on my side, you need to install avahi on the machine where casaos is located. you can try it, looking forward to your feedback.

nmendiboure commented 1 year ago

Hi,

Thank you for your answer. I followed the instructions from the link you sent and still didn't work... At least until I understood that there was a file '/etc/samba/smb.conf' (in addition of '/etc/samba/smb.casaos.conf') that I wasn't suppose to modify but I saw a line with 'min protocol = SMB2', so I just changed it with 'NT1' and now everything works, the shared folder appears into the network windows workgroup list in nemo.

baffee commented 1 year ago

Hi,

Thank you for your answer. I followed the instructions from the link you sent and still didn't work... At least until I understood that there was a file '/etc/samba/smb.conf' (in addition of '/etc/samba/smb.casaos.conf') that I wasn't suppose to modify but I saw a line with 'min protocol = SMB2', so I just changed it with 'NT1' and now everything works, the shared folder appears into the network windows workgroup list in nemo.

Yes, i just modify the conf file with NT1, it works.

spyderr67 commented 1 year ago

Hi, You really should avoid using SMBv1 due to known security vulnerability: https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858 There is an old bug within gvfs-browse causing the problem: https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1828107 there is a patch which solves the problem which you can find here: https://github.com/christgau/wsdd this worked for me.

LinkLeong commented 1 year ago

We are very happy to see that you have solved the problem, and we will consider improving this feature at a later stage. Thank you for your feedback.