Samba needs to be restarted after change in LuCI

I have been trying to configure SaMBa this evening.

It seems VERY broken :frowning: …Maybe I have missed something critical?

Every time you change anything via the “Network Shares” in LuCi, you must SSH to the router and type /etc/init.d/samba start to affect the changes.

Despite there being a “share home-directories” in LuCi, you cannot share home directories because they are hard-coded as not-shared in /etc/init.d/samba

There is no facility to add users …which must be done before you can run smbpasswd …and also implies that you cannot create home directories …

The only user on the system is root, and he is banned from logging on as samba

There is no facility to run smbpasswd …So you cannot set samba passwords …There is no interface for users to change their passwords.

It’s all very broken, and there are probably a dozen different ways to resolve it …but for now, just the ability to set a samba user+password and simply share the memory stick plugged in [enable/disable) would be a great.

Cheers,
BC

Its let’s say not broken, but “OpenWrt” lightweight way.

I can say that its easier to run samba inside of LXC container, then you will get normal distribution with all features.

You don’t have to type /etc/init.d/samba start - in LuCI go to System -> Startup - find samba and click “enable”

If you want home folders, you have to edit /etc/config/samba add option homes '1' (see doc https://wiki.openwrt.org/doc/uci/samba)

Openwrt does have smbpasswd (just checked, it’s there)

But if you want some “special” configuration run on OpenWrt, there is a way, but basically only in command line via SSH.

Setting for samba (and many others in openwrt) is generated from config stored in /etc/config/samba
Using also /etc/samba/smb.conf.template

You have 3 options.

  1. Be happy with config in /etc/config/samba (see doc https://wiki.openwrt.org/doc/uci/samba)
  2. Edit /etc/samba/smb.conf.template like you would do in normal smb.conf //danger
  3. Edit /etc/samba/smb.conf.template and script /etc/init.d/samba to add new options that will then work from configuration /etc/config/samba //even more danger and will be rewrited by turris update…
1 Like

I had, indeed, missed the rather critical “enable samba” in the startup section …so a big thanks for that :slight_smile:

Otherwise, thanks for tips …Once you’re at the BASh prompt, there are (as you highlight) many options …I think my post was more about the idea of getting samba working in a “friendly way” (ie. WebGUI config) …list of groups, list of users, list of directories, bunch of tick boxes :slight_smile: