Ticket #936 (reopened enhancement)

Opened 20 months ago

Last modified 7 weeks ago

Disable authentication in SAMBA

Reported by: frediusdarde@… Owned by:
Priority: normal Milestone: Firmware 2.3.7.0
Component: fon-base-firmware Version: N/A
Severity: normal
Cc: condellog@…, ilvalle@… Hardware: both

Description

I wish I had the option to disable authentication on a Samba connection to USB hard drive connected to the fonera2.0n.

Attachments

samba-uci-allow-anon.patch (326 bytes) - added by "Giovanni Condello / Nanomad <condellog@… 16 months ago.
Add options to uci for security and guest_ok
reloadsamba-allow-anon.patch (1.3 kB) - added by "Giovanni Condello / Nanomad <condellog@… 16 months ago.
Use the previous options in ReloadSamba?
restartsamba-allow-anon.patch (1.3 kB) - added by "Giovanni Condello / Nanomad <condellog@… 16 months ago.
Use the previous options in RestartSamba?
fonera-samba-unauth-access.patch (2.6 kB) - added by "Giovanni Condello / Nanomad <condellog@… 16 months ago.
Final version of the patch with WebUI support

Change History

Changed 20 months ago by matthijs

  • status changed from new to confirmed
  • severity changed from unknown to normal
  • component changed from fon-network to fon-base-firmware
  • hardware changed from 2.0n (FON2300) to both
  • version changed from 2.3.6.1 (Gari jr.) to N/A
  • type changed from request to enhancement

This is related to #850 and should probably be fixed in one go.

Changed 20 months ago by jfgthomassen@…

agree

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

Add options to uci for security and guest_ok

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

Use the previous options in ReloadSamba?

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

Use the previous options in RestartSamba?

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

Submitted first set of patches to allow this feature.

You have to set: samba.samba.guest_ok = yes samba.samba.security = share

and then run ReloadSamba? or RestartSamba?.

Next set of commits will allow to configure this via the Web GUI

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

Also, someone should review my work.

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

Last post, really. The last two patches are reversed (run the diff program with the parameters switched). + are - and vice-versa

Changed 16 months ago by matthijs

  • cc condellog@… added

Looking at your patch, it looks good. One remark, though: Perhaps it would make sense to have a single option, "anonymous" in the uci file instead of the separate security and guest_ok options you have now. For most end users, those two options are not meaningful, and they want just a single toggle: Allow anonymous logins. To make the luci webinterface change two options change two options with a single dropdown is probably possible, but a bit of a hassle. So changing over to a single uci configuration value and then making the ReloadSamba and RestartSamba scripts change both of the relevant settings based on that single uci config is probably the easier approach here.

Regarding the patch generation: It seems you use manual diff commands right now? If you edit the files with an svn checkout, you can also just use the "svn diff" command, which just shows the differences to the latest committed version. That might save you some headaches (no need to make a copy of every file you want to modify, for example).

Changed 16 months ago by anonymous

About diff: I know, but I was too sleepy to remember that.

I'll fix the patch as you suggested (since it also means less work for me, which is nice).

How about uci option samba.samba.disable_auth?

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

Final version of the patch with WebUI support

Changed 16 months ago by "Giovanni Condello / Nanomad <condellog@…

I've attacched the final revision of the patch. This one can be fully used via the WebUI (the setting is under

Dashboard >> Settings >> Fileserver

Changed 16 months ago by matthijs

  • cc ilvalle@… added

#472 is a duplicate.

Changed 16 months ago by frediusdarde@…

Thanks! How I can install this on my fonera2.0n? I am a novice user :)

Changed 16 months ago by Giovanni Condello <condellog@…>

As a novice user, I wouldn't suggest you to apply this patch manually. Just wait for the firmware to be released when it's ready

Changed 16 months ago by matthijs

I've applied and tested the patch, I'll commit it soon.

I made two changes: I renamed the option to "Anonymous", to be consistent with the equivalent FTP option and to prevent introducing a new string to be translated. Also, you didn't patch the ReloadSamba? script, only the RestartSamba? script. The former is used when reloading samba, for example when inserting an USB disk.

Thanks for the patch!

Changed 16 months ago by anonymous

Please take a look at bug #866, Revision [1726] patched only the RestartSamba? script and not the ReloadSamba? one. I'm writing this here since I cannot re-open that bug

Changed 16 months ago by matthijs

  • status changed from confirmed to closed
  • resolution set to fixed

(In [1863]) samba: Add an option to enable anonymous access.

This adds a uci option, "allow_unauth", that can be set through the WebGUI and sets "guest ok = yes" and "security = share" in the generated smb.conf. This allows clients to connect without logging in using the router password.

Thanks to Giovanni Condello for this patch.

Closes: #936

Changed 16 months ago by matthijs

  • milestone set to Firmware 2.3.7.0

Changed 15 months ago by matthijs

While playing around with smb access today, I found that this patch doesn't quite work like it should. Since samba is mapping anonymous access to the "nobody" user, and not all filesystems are mounted world-writeable, I couldn't write to my disks using smb.

In particular, vfat seems to map everything to the fonero user, ntfs makes everything world-writable (so ntfs worked for me) and ext just uses whatever permissions are on the disk.

I guess that making samba map anonymous access to "fonero" instead of "nobody" would help here, without introducing extra problems. With ext filesystems this might still give permission denieds for existing disks that use different uids/permissions, but I guess that anyone using ext should be able to figure that out...

What filesystem were you using with this?

Changed 15 months ago by "Giovanni Condello / Nanomad <condellog@…

I was using NTFS I think. Maybe adding

guest account = fonero

to the "anonymous" smb.conf can fix this issue.

Changed 9 months ago by matthijs

  • status changed from closed to reopened
  • resolution fixed deleted

ould be able to figure that out...

What filesystem were you using with this?

Changed 9 months ago by matthijs

Hmm, ignore that last comment, apparently I accidentally pasted something in the comment box :-)

Changed 9 months ago by matthijs

  • status changed from reopened to closed
  • resolution set to fixed

(In [1980]) samba: Set guest account = fonera for anonymous access.

This makes sure that when anonymous access is enabled, anonymous users can actually write to the shares instead of just read.

Closes: #936

Changed 7 weeks ago by matthijs

  • status changed from closed to reopened
  • resolution fixed deleted

Seems the last fix isn't perfect either: Any files written while authentication is enabled are owned (and writeable only) by root, while any files written while authentication is disabled are owned by fonera. Also, any files owned by root are not readable when logging in anonymously...

Add/Change #936 (Disable authentication in SAMBA)

Author


Please use your email address ("Name <email@adress>" or just an address) so we can contact you with further questions. Your email address will not be public. You will be automatically notified about further changes to this ticket.


If you need to paste file contents, command outputs, etc, please use the {{{...}}} syntax described here

Action
as reopened
 
Note: See TracTickets for help on using tickets.