How to run Syncthing on NAS542 as non-root, or elseway provide synced data rw possibility for users?

Options
Voland255
Voland255 Posts: 4
First Comment
edited March 23 in Personal Cloud Storage

I have admin and non-admin users on my NAS542, connected to NAS shares though Windows share drives accordingly to their NAS users (not as root). Although, when Syncthing (started as root from /opt/bin through /opt/etc/init.d/S92syncthing) copies new data from devices to NAS, all such files are set to root:root, so nor admin, nor non-admin users cannot edit, move, delete data from Windows clients. How can I solve this situation?

All Replies

  • Voland255
    Voland255 Posts: 4
    First Comment
    edited March 23
    Options

    There no sudo, no sudoers file, no runuser command, no PAM at NAS542. No option like "—run-as-user" in syncthing. No possibility to run syncthing as a per-user service. Set chown of "syncthing" file as new user "syncthing" and group "everyone" is futile - all newly synced file, of cource, are root:root, because "syncthing" file called by root process.

  • Voland255
    Voland255 Posts: 4
    First Comment
    Options

    Of course, checkbox "Ignore permissions" in syncthing shared folders are checked.

  • Voland255
    Voland255 Posts: 4
    First Comment
    edited March 24
    Options

    At least how to make synced files/dirs to have mod 666, not 644! 😣

    Of course, I can manually set permission of directories (to possibility of move/delete files inside) or files (for possibility to edit them), but do it every time, after each sync, for each new directory or file I need to edit on Windows, where I logged as admin… 😓

  • Mijzelf
    Mijzelf Posts: 2,613  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Options

    The is no sudo, but you have su. From the startscript of my Pulse package:

    Startup()
    {
    mkdir -p ${PKG_HOME}
    chown ${PKG_USER} ${PKG_HOME} su -m ${PKG_USER} -s /bin/sh -c "HOME=$PKG_HOME ${PKG_ROOT}/bin/${PKG_DAEMON} -home=$PKG_HOME -gui-address=\"$( GetLink )\" >${PKG_HOME}/lastlog 2>&1 & " }

Consumer Product Help Center