IceWhaleTech / CasaOS

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

[Issue] SMB Sharing needs to support/enforce authentication #1113

Open iAlchemy opened 1 year ago

iAlchemy commented 1 year ago

Description

Presently any created shares are public. I accept that CasaOS is designed to be a personal home cloud however share security should require the credentials used for the Admin GUI.

Presently a typical share is configured ...

[Documents] comment = CasaOS share Documents public = Yes path = /DATA/Documents browseable = Yes read only = No guest ok = Yes create mask = 0777 directory mask = 0777 force user = root

It should not include public or guest, instead it should include ...

valid users = username

where username is the Admin GUI user. Perhaps the "Share Folder" dialog could have the option to allow public/guest access else it includes force user by default.

In the meantime ... where is the smb.conf template stored such that I could change it before creating shares?

Additional Information

 - OS: linux
 - CasaOS Version: 0.4.3
 - Disk Total: 225140 
 - Disk Used: 2677 
 - System Info: [Debian GNU/Linux 11   \l Bit:64 Mem:7811M Core:4 Linux casaos 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux]
 - Remote Version: 0.4.3
 - Browser: Chrome 
 - Version: 113.0.0.0
ETWang1991 commented 1 year ago

Got it

DouglasMacKrell commented 8 months ago

Just picked up a Zimaboard and started running Casaos for the first time - and was pretty surprised to find that the only way I could connect to my shared folder from my Mac was through a un-authed Guest connection.

morrolinux commented 7 months ago

A "SMB users and permissions" panel in CasaOS would be ideal, but in the meantime, I think the default should be to at least let the user authenticate with the same credentials as the web UI, that's a pretty reasonable and straight forward default config to implement.

adam-lagoda commented 5 months ago

Any updates on the topic?

cmartorelli commented 5 months ago

+1 for a update on this issue

bilalbayasut commented 5 months ago

I was surprised as well that the samba is not yet authenticated, so +1 for update on this issue

HackerPVPLOL commented 5 months ago

+1 for update on this issue

adam-lagoda commented 5 months ago

Seems like a pretty straightforward implementation https://ubuntu.com/server/docs/samba-share-access-control

thor9898 commented 5 months ago

This is highly needed.

Tronicgg commented 4 months ago

Highly needed indeed.

baffee commented 4 months ago

In the release note of 0.4.7, it mentioned enforce authentication is avaible. How to config it?

ksdfpr commented 3 months ago

Any update on this? Highly recommended!

tuvietnamm commented 3 months ago

any update on this?

JPLoureiro83 commented 3 months ago

What a letdown, everything is wide open for everyone, from any device connected to the same network. This leaves me no choice but to go find another alternative and stop using CasaOS altogether. What a shame... Please fix this!

cmartorelli commented 3 months ago

I installed Samba and set it up with the correct amount of users and then I deleted the Samba config file that Cassa OS installed. That did the trick.

adam-lagoda commented 3 months ago

I installed Samba and set it up with the correct amount of users and then I deleted the Samba config file that Cassa OS installed. That did the trick.

Can you link a step by step solution please?

cmartorelli commented 3 months ago

I am by no means a SAMBA expert so I really don't have step by step instructions. But it was something like this... find the SAMBA conf file that CASA OS created it should be in /etc/samba/smb.conf. rename it or delete it. Then I followed these instructions ...https://ubuntu.com/tutorials/install-and-configure-samba#1-overview

adam-lagoda commented 3 months ago

But wouldn't CasaOS overwrite your changes? You might need to lock the file to get consistent functionality

tuvietnamm commented 3 months ago

changing the /etc/samba/smb.casa.conf did the trick for me. guest ok = no then sudo smbpasswd -a username to set a password for username (same as casaos)

strassenberg commented 3 months ago

then sudo smbpasswd -a username to set a password for username (same as casaos)

Hi tuvietnam! Propably did something stupid, but when I try to add users, got errors:

root@casaos:~# sudo smbpasswd -a ray  
New SMB password:
Retype new SMB password:
Failed to add entry for user ray.

Any idea?

johnMaluco commented 2 months ago

The exact same thing happened to me too.

Makc0809 commented 2 months ago

+1, just wait update ..

Avhlin commented 2 months ago

Here is just post the way to Edit samba.casa.conf file

And add user to SMBdb to authenticate Share location

https://github.com/IceWhaleTech/CasaOS/discussions/1403#discussioncomment-9283285

Nathan118-S commented 4 weeks ago

We need this

KadinM commented 14 hours ago

Is there any update on this? This is a minimum level feature in my opinion, it would be great to get it added in an update :)