You are not logged in.
Hi all. Long time no see.
I am trying to set up NFS but the mounts only show up as root owned without my local user having read access. Relevant configs below.
On Server (Arch):
/etc/exports
/srv/nfs/ 192.168.0.0/24(rw,sync,crossmnt,anonuid=5001,anongid=5001,fsid=0)
/srv/nfs/document 192.168.0.0/24(rw,sync)
/srv/nfs/downloads 192.168.0.0/24(rw,sync)
/srv/nfs/pictures 192.168.0.0/24(rw,sync)
/etc/fstab
/home/<username>/Documents /srv/nfs/documents none bind 0 0
/home/<username>/Downloads /srv/nfs/documents none bind 0 0
/home/<username>/Pictures /srv/nfs/documents none bind 0 0
Username ID
5001
On Client PC (Fedora):
/etc/fstab
<hostname>:/documents /home/<localusername>/Documents nfs user,nfsvers=4,defaults 0 0
<hostname>:/downloads /home/<localusername>/Downloads nfs user,nfsvers=4,defaults 0 0
<hostname>:/pictures /home/<localusername>/Pictures nfs user,nfsvers=4,defaults 0 0
Username ID
1000
Things of possible note:
If I do mount -a from the client PC they mount with root:root permissions.
Hostname is in my /etc/hosts file and maps to the server IP.
NFS service has been added/allowed through firewalld.
File system on Server is ext4, File system on Client is btrfs.
Last edited by felixculpa (2022-10-14 17:11:48)
Offline
So I was super confused by this because I had a user account on both with the same name, but different UID. It's all about the UID with NFS. So I moved the files on the server to a user with a matching ID and this (I'm assuming, still moving files) should fix the problem?
Offline
https://wiki.archlinux.org/title/NFS
NFS expects the user and/or user group IDs are the same on both the client and server. Enable NFSv4 idmapping or overrule the UID/GID manually by using anonuid/anongid together with all_squash in /etc/exports.
Online
I tried using the anonuid and anongid both with them set to 1000 or 5001 and they both ended up causing weird behavior. So I just used a different user with the same ID.
Offline
"together with all_squash"?
But aligning UIDs is oc. fine - alternatively you could use UID mapping w/ NFS4
Online
Hmm. I may try that later, I think all_squash is a default option because root couldn't do anything until I added the opposite option explicitly.
Offline