How setup smb/cifs correct ?

  • After I already messed up a CIFS and NFS data storage I'll will try again with a CIFS.


    Is it necessary to follow a certain sequence, which steps should be done in which order ?
    for instance :


    1. Set up a user in ( ARM ) Access Right management
    2. Set up a Shared Folder in ARM
    3. Set up a Shared Folder in SMB/CIFS
    4. Set privileges and ACL in ARM


    Or is it not neccessary to follow a certain sequence, so I can start where ever I want and it is possible to enter/change
    something ?

    • Offizieller Beitrag

    Looks good. You should only need 4 if you need finely tuned permissions.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.6 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • For a media folder I do this:
    1) I make a new directory at /media/uuid/Media in command line, the "Media" folder. (mkdir Media in root ssh session)
    2) Then I make the Media folder shared folder under /Access Rights Management in the web-gui
    3) Then I enable smb/cifs and share the Media folder there.
    4) Then I create my users in ARM. 1st user has r/w set in privileges, I do not use acl, and the rest are read only.
    5) To add folders/files in the Media folder I go to Netowork on my Windows desktop and click on the OMV machine. Then log in with the r/w access user. Then I go into the Media share and add folders/files via that method. The 1st 3 folders I add in Media are always Movies, Music and TV. When you do this all added media will have user1:users ownersship, user1 would be whatever name you use for that 1st user. The Media folder has root:users ownership.


    It works really well for me. All media is under just this one share and streams via DLNA or you can access via SAMBA. I don't like NFS and it seems pretty dated to me. If you are using Windows machines SAMBA(SMB/CIFS) is the way to go. I can tell you from experience, it is better to use a shared folder in only one service. I never use the media folder with NFS or FTP. I would make different shares for those services and move the data to where it is needed. You make bad practice and a permissions nightmare by trying to use 1 shared folder with many services. It's bad, bad, bad. I don't care what ayone else says. I never had the errors/problems/nightmares others do by strictly following this rule of not using shares with more then 1 service. Things like MiniDLNA are exceptions to this rule because they do not mess with the permissions/owndership of the underlying shares/folders/files.


    Viel GLu"ck!

  • Creating separate shares for different services just seems odd. While it works and apparently works well this way, it still for some reason seems odd to me.


    Why?


    Well in my thinking and correct me please if I'm wrong, but the method to access a share is just a transport protocol. Much like a method of transportation, car, bus, taxi, or foot that you may use to go to and from work. Your home is still where you left it and work is still where it is. Much like your computer and the shares on the server.


    Also the major NAS box makers seem to make one share available through all the different methods, ftp, samba, http, afp and so forth. So it almost begs the question. What is it they are doing to do that?


    So what is it I am missing as it is obviously something?


    Help me understand this please.


    Thanks


    Dave

  • I have a small question. I followed the steps from tekkbebe on a fresh install.
    1. created a new directory (NAS_Various) using the web manager (under ARM -> shared folder, admin r/w, users r/w, others r). (tried via the ssh connection first but gave me issus with rights later on). So i have /media/uuid/NAS-Various.
    2. enabled smb/cifs abd shared the folder like you suggested.
    3. then I created 1 user in ARM. I select the user under ARM-shared folders and set r/w set in privileges.
    4. I can log on to the samba share via finder, enter the user and password. i am then able to make more folders and add stuff.


    Everything fine so far. Next step is to add the omv-extra plugins and install transmission.
    I tell it to use a complete and incomplete folder. So i then have /media/uuid/NAS-Various/Complete and /media/uuid/NAS-Various/Incomplete.
    These are both created by the plugin.


    When i go to these folders via samba i can access them but when i try to remove files i get access denied.


    Do i have to use the ACL to allow the users r/w access to these subfolders? Because i gave r/w rights to the user for the higher folder? Or am i missing something? Shoul i need to doo this for all services, because i plan to add more using miller's script.


    I hope you can give me some advice,

    OMV 0.5.24 fedaykin - 64 bit
    HP N40L Microserver, 2gb Ram

  • Ok. Here is the output of ls -la:


    Code
    root@openmediavault:/media/15d150d1-df32-4179-90d1-400accfdf524# ls -la
    total 44
    drwxr-xr-x 4 root root   4096 Dec  2 22:53 .
    drwxr-xr-x 5 root root   4096 Nov 30 09:04 ..
    -rw------- 1 root root   6144 Dec  2 22:56 aquota.group
    -rw------- 1 root root   7168 Dec  2 22:56 aquota.user
    drwx------ 2 root root  16384 Nov 29 23:28 lost+found
    drwxrwsr-x 2 root users  4096 Dec  2 22:56 NAS_Various

    OMV 0.5.24 fedaykin - 64 bit
    HP N40L Microserver, 2gb Ram

  • Code
    root@openmediavault:/media/15d150d1-df32-4179-90d1-400accfdf524/NAS_Various#  ls -la
    total 24
    drwxrwsr-x 4 root                users 4096 Dec  2 23:04 .
    drwxr-xr-x 4 root                root  4096 Dec  2 22:53 ..
    drwxrwsr-x 3 debian-transmission users 4096 Dec  2 23:05 Complete
    -rwxrwxr-x 1 Paul                users 6148 Dec  2 23:05 .DS_Store
    drwxrwsr-x 2 root                users 4096 Dec  2 23:03 Watch


    When i take a look ar the ACL list now i notice that all subfolders are r/w as well. Which was done by the chmod command.
    Why won't it work when doing this in the web gui?


    And what i do not get is that the Complete folder is owned by debian-transmission and the watched folder is owned by root but both are made by the plugin. Strange?

    OMV 0.5.24 fedaykin - 64 bit
    HP N40L Microserver, 2gb Ram

    Einmal editiert, zuletzt von Eoghlear ()

  • Yes, they (Complete and Watch folders) are the users group. Any user you make in the web-gui should be able to delete if you give them read/write on your NAS-Various folder. If you add a new folder you need to make sure it is chmod 775 and has the users group as primary group. If not you will need to change some things. Try it now. The incomplete folder may be created the 1st time there is an incomplete file.



    PS- I never use ACL because you don't need it if you understand chown and chmod, and not dealing with a lot of users.

  • Is it not strange that when i create two folders using the transmission web gui they get two different owners?
    Complete is owned by debian-transmission and watch by root.
    And when downloading it does not create a incomplete folder.


    So in short:
    1st I need to chmod -r 775 the highest folder on each share for this to work.
    2nd I need to set priviliges for the user (max 2 users on the system).


    So it seems the web gui does properly change the permissions?
    Otherwise i would not need to use chmod myself.


    I used ACL before because i wanted give certain permissions to several users/folders. It messed everything up.
    So i am going to keep it simple this time.


    Thanks for the explanation and help.

    OMV 0.5.24 fedaykin - 64 bit
    HP N40L Microserver, 2gb Ram

  • Ok, just because when you create a shared folder and share it with SMB/CIFS does not mean that folders created in will have the proper chown and chmod. You need to assess if changes are needed and will work properly with the shared folder. The chmod -R 775 give read/write/execute to own and users in a given group. That is what the 1st 2 7s in 775 stand for. 1st 7 is owner perms, 2nd 7 is users perms and 3rd is others (which has value of 5 read & execute). In you case your users could not delete files in the new folder because the folders most likely had different perm, like 750 or something. The ownership was ok because the belonged to the users group. There is another long post somewhere on forum that discusses privileges and ownership in far greater detail. I will try to give you a link sometime.


    PS- The -R is recursive option and when run on a folder will give all subfiles/folders the same vaules that is being give to the folder in question. The -R can be used with chmod and chown.

  • Ok. Think i have got it all figured out.


    Exept this:
    Added a new drive. Created a share (with permissions set as admin r/w users r/w others r) via the web gui and enabled it in samba.
    Then set my user priviliges to r/w. then logged in via ssh and went to /media/uuid and used chmod -R 775 on the share NAS_TVShows.
    Since the -R means recursive all new folders should have r/w for owner and users.
    Then why do newly created folders via ssh (root) and samba (user) only have r and not r/w for the users group.


    Code
    root@openmediavault:/media/abb7dd00-2bfb-46a6-8fdb-ea30ff15e400/NAS_TVShows# ls -la
    total 32
    drwxrwsr-x 6 root users 4096 Dec  4 22:45 .
    drwxr-xr-x 5 root root  4096 Dec  4 22:23 ..
    drwxrwx--- 3 Paul users 4096 Nov 18 21:53 Almost Human
    drwxrwx--- 4 Paul users 4096 Oct 14 17:57 Banshee
    -rwxrwxr-x 1 Paul users 6148 Dec  4 22:37 .DS_Store
    drwxr-xr-x 2 Paul users 4096 Dec  4 22:37 Test
    drwxr-sr-x 2 root users 4096 Dec  4 22:45 Test3


    It should not be necessary to execute the chmod everytime on the highest folder right?

    OMV 0.5.24 fedaykin - 64 bit
    HP N40L Microserver, 2gb Ram

  • Ok, when you setup the shared folder the dropdown with owner, users, others sets up chmod. But that doesn't mean stuff you put in there will have the same chmod (privileges/perms) or owndership. That is why sometimes you will have to fix it again. Say you moved some folders/files in the share as root user. There will be root:root owndership and chmod will probably be 755. You will have to fix these things a lot. The best way to move data to the shares is with one of your users that has rights to the share. It will give ownership as the user's username:users (the group). Read my post on this thread and it will help you to understand chmod and chown better. But if you have a folder the everthing need to be same owndership and chmod it is easy to use these commands to get it working with services in omv.


    chown -R root:users foldername
    chmod -R 775 foldername
    The above are all that is need for a folder to work with plex. Plex just needs other read-only (the 5 value in chmod). People are messing with acl all the time when setting up folders for plex. I'm like, oh weh....


    Here is more info.:


    http://forums.openmediavault.org/viewtopic.php?f=16&t=2652


    PS- You can use the "stat" or "ls -la" commands to check owndership and perms. Learn how to use them. They are important.

Jetzt mitmachen!

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