permissions headaches between GUI and terminal

  • I'm running the latest OMV5.5 on an AMD computer installed on the primary hdd, as the primary os. I have a separate partition for my data from my installation.


    I have Samba, NFS and SSH running on OMV. I can log into the web interface without a problem. I'm primarily working on the Samba share for simplicity. My desktop setup is a Mac Mini with 11.0.1 (Big Sur) installed. I created a user on OMV with the same username on my Mac. I gave the user permissions to access the Samba share folder I created. With Finder (like explorer for Mac) I can access the shared folder, create folders, copy, paste, I basically can use it fine. When I access the folder with the Terminal app same username, and try to make a folder, or delete, or move or do anything, I'm not allowed. I get the error, "Permissions not allowed." Obviously this is a problem between the GUI and the Terminal, even though both are run with the same username. Any ideas on this?? I'm sure it is a permissions error that I cannot seem to put my finger on.

    • Offizieller Beitrag

    When you set privileges for a shared folder, there is an information displayed:



    So with privileges you set user access rights when accessing via SMB (for example).

    When you are in CLI, you are dealing with file system permissions.

  • Thank you for the feedback, I think I understand that. Here is what I thought. When I created a user on OMV with the exact same username as my Mac user I thought that would allow access. Let just say for example, my Mac user name is: johndoe I then created a user on OMV with the same name, johndoe, and gave it permission. When I mount the folder with finder, I mount it using the username johndoe, and the password I setup in OMV. It is mounted on my macos at /Volumes/JDFolder I can go to /Volumes/JDFolder in the terminal but cannot do anything. When I run ls -l the owner shows as johndoe... however that johndoe is different then the OMV johndoe? How can I allow CLI to access the Samba shared folder, and allow changes? Ultimately, I want to run rsync and rsnapshot as my regular user on the Mac. Clearly I'm confused about how to get that done.

  • Even if usernames are exactly the same across systems, this doesn't mean that the numerical user IDs are the same, and that's what matters.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Ok here it is:


    I changed my username everywhere it appeared to johndoe for security. I don't think it matters much, but I tend to error on the side of paranoid.

  • Even if usernames are exactly the same across systems, this doesn't mean that the numerical user IDs are the same, and that's what matters.

    I think you are right, all users are assigned a userid #, and the name is just 'user friendly'. I have dealt with that between Linux systems when transferring data between two systems and same username.


    So my question now becomes, can someone point me in the right direction to gain access to my samba share via cli on a mac? I also have not been able to ssh into the system from my Mac. I can really only access it via the WebGUI.

  • To ssh into OMV, by default, the user must belong to the ssh group.


    You can change the numerical ID of a user by editing the file /etc/passwd but this may possibly break other things. You will probably will also have to change the ownership of the files and folders to the new ID number.


    It may be easier to sufficiently relax the permissions of the files and folders, but it's hard to say without seeing them first.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • To ssh into OMV, by default, the user must belong to the ssh group.


    You can change the numerical ID of a user by editing the file /etc/passwd but this may possibly break other things. You will probably will also have to change the ownership of the files and folders to the new ID number.


    It may be easier to sufficiently relax the permissions of the files and folders, but it's hard to say without seeing them first.

    I don't think I want to mess around with changing the numerical ID... that certainly would be messy.


    I'm digging into permissions on the folder. I'm a little confused as to why I can access the folder via GUI (Finder on my Mac) but not via Terminal (CLI) (again from my Mac). What is the difference?


    I appreciate the help.


    sak.rice

  • I got it!!!


    There is a difference if you mount the Samba shared folder with GUI, you have GUI access, but not access through the terminal, even if you can see the folder.


    If you mount the Samba share through the terminal, apparently, you will have terminal access. Or one of the many checkmarks I made happened to be the right one. Alternatively, because I mounted it via cli, I made the mount point in my home folder. One of those apparently made the difference.


    In Mac Terminal, I successfully mounted the share with these commands:

    (Notice that I mounted it in my home folder. I was able to do everything as user, and didn't need sudo.)


    Code
    mkdir ~/MountPointFolder
    mount_smbfs //username@192.168.1.123/SharedFolder ~/MountPointFolder

    This allowed me to then run a quick backup via rsync in cli:

    Code
    rsync -av ~/folder/to/backup ~/MountPoint/Folder

    That seems to work well.


    Thanks to both of you for helping me clarify a few things. It gets complex quick when dealing with usernames, different systems, and then GUI vs CLI access. Clearly there are things that are still way over my head, but this seemed to work for me.

Jetzt mitmachen!

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