I want to mount a network drive on a NAS (Synology DiskStation) when my linux server (old headless desktop running Ubuntu 20.04.2 LTS) boots, and I want to make the share available to all users under /mnt. I plan to see if I can write a script to back up some files to this share regularly so that if anything happens to my server, my files are back up on my NAS.
I have set up the network share with NFS on the NAS (IP address of linux server has read/write, Squash: No mapping), created the share directory under /mnt, I mounted the share, copied a few files to it as my regular non-root user, checked the files were on the NAS. Everything worked great. I rebooted, and the mount was gone. I expected this and looked up how to have the system mount this share at startup. I added the following line to my fstab.
<nas_ip>:/volume1/share /mnt/share nfs user,rw,hard,intr 0 0
I rebooted, went to /mnt, and attempted to "cd /share" and get "Permission denied".
Eventually getting frustrated, I switched to root (sudo -i) and "cd /share" worked perfectly. I even created a new folder directly on the NAS and verified it was visible via command line as root. The network share is mounting and working, but no user besides root has access.
Is there something else I need to do? As I understand it, the "user" option under fstab should give all users access to the mount. Am I doing something wrong?