Permissions error

  • Hey there, trying to make a simple NFS share that I can access over the local intranet but I keep getting permission errors, everything is root. Hopefully I've given enough information below, but if you need any more just ask - would appreciate any help. Many thanks.

    export folder permissions
    root@openmediavault:/export/data# ls -la

    total 4

    drwxrwsr-x 1 root users 0 May 13 14:59 .

    drwxr-xr-x 3 root root 4096 May 13 14:27 ..


    /etc/exports file
    # This file is auto-generated by openmediavault (https://www.openmediavault.org)

    # WARNING: Do not edit this file, your changes will get lost.

    # /etc/exports: the access control list for filesystems which may be exported

    # to NFS clients. See exports(5).

    /export/data 192.168.0.0/24(fsid=3e3f2218-deed-411a-b43e-4ed503a61c8a,rw,subtree_check,insecure,root_squash)

    # NFSv4 - pseudo filesystem root

    /export 192.168.0.0/24(ro,fsid=0,root_squash,no_subtree_check,hide)


    Client command

    mount -t nfs 192.168.0.88:/export/data/ /mnt/data/


    Also tried using the -o rw option as well as mounting to a /tmp directory (not that itd make a difference) with the same results

    root@DietPi:/mnt/data# ls -la

    total 4

    drwxrwsr-x 1 root users 0 May 13 14:59 .

    drwxr-xr-x 7 root root 4096 May 13 15:26 ..

    root@DietPi:/mnt/data# touch test

    touch: cannot touch 'test': Permission denied




    I also tried specifying the client IP 192.168.0.233 manually, as well as adding root_squash on to the options, same result.

    • Offizieller Beitrag

    Doing things as root with root_squash is your problem. Your data directory is owned by users. The remote system will need a user in a group with the same ID as users group on the nfs system.

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

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | 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!

  • > Doing things as root with root_squash is your problem

    I haven't added root_squash to the tags, but I've noticed its on the auto-generated # NFSv4 - pseudo filesystem root - is that where the issue is?

    > The remote system will need a user in a group with the same ID as users group on the nfs system.
    Sure, so I'd presume it'd be okay to add the root user to the group with the same ID?

  • Okay, I've added the root to the users group on the remote system, that still didn't fix the issue

    root@DietPi:/mnt# getent group | grep users

    users:x:100:

    root@DietPi:/mnt# sudo usermod -a -G users root

    root@DietPi:/mnt# mount -t nfs 192.168.0.88:/export/data/ /mnt/data/

    root@DietPi:/mnt# cd data

    root@DietPi:/mnt/data# ls -la

    total 4

    drwxrwsr-x 1 root users 0 May 13 14:59 .

    drwxr-xr-x 7 root root 4096 May 13 15:29 ..

    root@DietPi:/mnt/data# touch test

    touch: cannot touch 'test': Permission denied

    • Offizieller Beitrag

    /export/data 192.168.0.0/24(fsid=3e3f2218-deed-411a-b43e-4ed503a61c8a,rw,subtree_check,insecure,root_squash)

    is that where the issue is?

    No. it is in the export/nfs share too.


    Sure, so I'd presume it'd be okay to add the root user to the group with the same ID?

    No. Why are you using root? root is technically a member of every group already.

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

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | 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!

  • > No. it is in the export/nfs share too.
    I removed that part and it still gave me the exact same probem.


    > No. Why are you using root? root is technically a member of every group already.
    I've just got the root account set up at the moment.

  • I dont think its because of the root_squash, because I didnt have that by default and it was causing the same issue. I only added it because I thought that might make a difference but it didn't

    , as well as adding root_squash on to the options, same result.

    • Offizieller Beitrag

    Another update: Turns out this is highly vulnerable to priv esc, so maybe not. I'll do some more research into changing from the root user.

    This is not privilege escalation. Yes, users could delete or change more files but it is not as bad as you think. Since you really shouldn't be using root, permissions shouldn't be set to nobody.

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

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | 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!

    • Offizieller Beitrag

    Yes it is. You can abuse SUID permissions.

    I didn't say it wasn't possible. It is only escalation to change files on the nfs share. You wouldn't actually be hacking the OMV box itself. On an internal network, I see it being very little risk. The attacker would have to have access to the client as well. Lots of things aren't secure when an attacker has access to a client. And since many samba users leave perms at world writable/executable, I don't think this is any different.

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

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | 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!

    Einmal editiert, zuletzt von ryecoaaron ()

Jetzt mitmachen!

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