samba shares control through ssh commands

Hello
I`ve boght NAS 326 and now got a task to transfer all our company files to it. No problem, users and shares - created via ssh. But there are options to enable the share and its access rules, just adding strings to smb.conf doesn`t solve the problem. Each user has a share so clicking "enable" and putting  rw-flags  in the web-iface - that`s too long.
I need a fast and simple solution via ssh for future installations of the same NASes.
Please, help.

All Replies

  • Mijzelf
    Mijzelf Posts: 2,600  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    I'm afraid there is no easy way. Smb.conf is on boot (and on each change) dynamically generated by the backend, and the actual data is stored in a database which resides in flash (mounted on /etc/zyxel/)
    It is possible to patch the /etc/init.d/samba.sh to use an alternate copy of smb.conf, but in that case there is no relation between the backend (and webinterface) and the actual shares anymore. Further this has to be done on each boot, as /etc/init.d/samba.sh is volatile. If you want something like this, have a look at my 'samba replacement script'  for Entware on older NSA boxes. If you want I have also ways to execute a script on boot.
    Another option could be to backup the configuration of a furnished box, and put that in the others. Don't know if that actually works, though. Maybe the configuration is hardware dependent.


Consumer Product Help Center