Hello, I'm new to FreeBSD. I'm trying allow non-root users to be able to freely mount NFS filesystems, but I'm not sure what I'm missing? Mounting physical media is working well, but the moment I try to mount an NFS disk it throws an error.
I'm both new to FreeBSD and NFS filesystems, so I'm sure there something obvious that I'm missing, any help would be greatly appreciated, thank you!
I was following the following threads/docs:
Initially, I assumed that it was giving such error due to a permission error with the virtual node associated with XXX.XXX.XXX.XXX:/share/path, but I couldn't seem to find any node. So instead I set the physical diskk, /dev/da0s1a, to be read-only and try to mount it, to see if I could reproduce the error with other devices, but it instead threw a different permission error:
Also to note, running the same NFS mount command as root user, seems to work as expected.
I'm both new to FreeBSD and NFS filesystems, so I'm sure there something obvious that I'm missing, any help would be greatly appreciated, thank you!
I was following the following threads/docs:
- Thread mounting-usb-flash-and-dvd-as-non-root-user-freebsd-10.45860
- https://docs.freebsd.org/en/books/handbook/disks/#_device_configuration
Code:
$ sysctl vfs.usermount
vfs.usermount: 1
$ cat /etc/groups | grep 'operator'
operator:*:5:root,user
$ ls -l /mnt/user/
drwxr-xr-x 2 user user usb1
drwxr-xr-x 2 user user network_share
$ ls -l /var/da0s1
crw-rw---- 1 root operator /dev/da0s1a
$ mount /dev/da0s1 /mnt/user/usb1
$ mount -t nfs XXX.XXX.XXX.XXX:/share/path /mnt/user/network_share
mount_nfs: can't update /var/db/mounttab for XXX.XXX.XXX.XXX:/share/path
$ ls -la /var/db/mounttab
ls: /var/db/mounttab: No such file or directory
Initially, I assumed that it was giving such error due to a permission error with the virtual node associated with XXX.XXX.XXX.XXX:/share/path, but I couldn't seem to find any node. So instead I set the physical diskk, /dev/da0s1a, to be read-only and try to mount it, to see if I could reproduce the error with other devices, but it instead threw a different permission error:
Code:
# chmod g-w /var/da0s1
$ ls -l /var/da0s1
crw-r----- 1 root operator /dev/da0s1a
$ mount /dev/da0s1 /mnt/user/usb1
mount: /dev/da0s1a: Operation not permitted
Also to note, running the same NFS mount command as root user, seems to work as expected.
Code:
# mount -t nfs XXX.XXX.XXX.XXX:/share/path /mnt/root/network_share