Create NFS user account?

Discussion about using NAS on Linux and Unix OS.
Post Reply
Starting out
Posts: 42
Joined: Fri Apr 08, 2011 9:52 am

Create NFS user account?

Post by dutsnekcirf » Mon Apr 15, 2019 11:48 pm

NFS is weird and confusing to me and I'm hoping to get some clarification on how to set it up correctly. I have a Linux VM that is successfully mounting an NFS share on my Qnap NAS. In order to achieve this I edited the /etc/fstab file on my VM with the following line: /mnt/MyNAS/Public nfs rw,hard,intr 0 0

The problem though, is that permissions are not quite correct. The VM is writing to the NFS share using a user account called "seed". On the VM the "seed" user account has a UID & GID of 1001. Whenever the VM attempts to write any files to the Qnap they get written with those user a group file ownerships. If I SSH into my Qnap and view those files with an "ls -l" then I can see they have 1001:1001 ownership. If I were to instead create some files on the Qnap using the Qnap's admin account then the VM is unable to read those files. So in an attempt to fix this I created a user account on the Qnap called "seed" and added this account to the administrators group. However, the seed account on the Qnap does not have the same UID & GID as the account on my VM. According to the /etc/passwd file on the qnap the seed account is setup as follows:

Code: Select all

seed:x:506:100:Linux User,,,:/share/homes/seed:/bin/sh
Should I edit the /etc/passwd file to have 1001:1001 rather than 506:100 for this account?

What is the correct way to do this? Should my VM be mounting the NFS shares in a different manner?

Post Reply

Return to “Linux & Unix (NFS)”