Correct Read/Write permissions on NAS (Newbie)

  • Dear OMV users,


    I am currently running a BananaPi with armbian and OMV, which I want to use as NAS.


    There are two devices attached to it:
    - USB Stick
    - External HDD (via USB)


    I managed to set up the smb share and want to access it via my linux desktop computer. Unfortunately, I cannot access all the files and directories on the External HDD. On the USB-Stick, however, everything works fine. Since I am no expert in linux rights management, I hope some experienced users can give me some feedback on my setup.



    Checking the smbshare on my NAS-System:

    Source Code
    Edit Source Code

    • ls -l /srv
    • drwxrwxrwx 1 root root 4096 May 10 22:29 dev-disk-by-id-usb-General_USB_Flash_Disk_01070000000000E4-0-0-part1
    • drwxrwsrwx 13 MyUser2 users 4096 May 10 23:25 dev-disk-by-label-NAS

    So I think the problem lies here. My external HDD belongs to MyUser2, whereas the USB Stick belongs to root. I created both shares using the webgui, so I dont see my mistake here.


    ----------------------------


    NAS-System: ARMBIAN 5.25 stable Debian GNU/Linux 8 (jessie) 4.9.7-sunxi


    root
    MyUser1 (do I still need a dedicated user here? If I want to make updates to debian vie ssh I could use root for that. Otherwise I leave the system as it is anyway)


    OMV 3.0.74 (running on NAS-System):
    admin (for weblogin only)
    ShareUser1 (created via webgui, the only user allowed to access the NAS share)


    Desktop-Computer:
    root
    MyUser2

  • You were right! Some folders on the external HDD do only have access for myUser2 (=the user of my desktop computer):


    myUser2 (group=myUser2)

    Code
    drwx------  8 myUser2 myUser2      4096 Sep 18  2016 TestFolder

    This makes sense, because I moved the files and folders onto my external HDD using my Desktop computer via USB. So after doing

    Code
    chmod -R ugo+rw ./

    I should be able to access all folders and files on my NAS via samba. Files on my NAS are accessed via samba user ShareUser1 (group: users) and this would be allowed by the o+rw option in the permissions.



    The only problem is that, when I move a file via samba onto the NAS, it is then owned by ShareUser1 (group: users). In other words, when I plug my external HDD into my desktop computer via USB some time, I won't be able to read those files because I would access it with myUser2 (group=myUser2).



    So either I change all files to o+rw (this makes me a bit nervous from a security point of view) or I apply the same group for myUser2 and ShareUser1 and allow g+rw. Would that work even if the users are defined on different systems?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!