Only Root can mount NFS shares

I’m trying to get NFS shares to mount automatically from a Debian based server. I’ve edited the /etc/fstab with the relevant information… but I get the error stating that only the root user can mount the folders.

the lines in fstab are:

192.168.1.*:/media/Music  /mnt/Music nfs defaults 0 0

The NFS server side is fine since my Hackintosh is able to access it. So I’m guessing the fault lies from the client side. Can anyone help me?

For me there is a bit of confusion here.

You say you want it mounted “automatic” (which is in most cases another word for “by magic”). But then you start talking about mounting by root or user, which is imho something different.

But first, reading your /etc/fstab line, I see that the server is identified by 192.168.1.*. I doubt that that is a valid “server’s host name”.

The entry in /etc/fstab (after correction for the server’s hostname) will make that the file system is mounted at boot (Is that what you call “automatic”?).

And about mounting “by the user” (why? the file system should be there from boot until shutdown already), this is regulated by the following mount options:

user
Allow an ordinary user to mount the filesystem. The name of the mounting user is written to mtab so that he can unmount the filesystem again. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid).

and

users
Allow every user to mount and unmount the filesystem. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line users,exec,dev,suid).

BTW this is all in the man pages

man 8 mount
man 5 nfs

That works for me, except it is an openSUSE server.

The difference: I am not use “/etc/fstab” for the NFS mounts. Instead, I am using the automounter (the “autofs” service).

Autofs guide

I have NFS client running with /etc/fstab entry. Both work. Both are for different purposes.

But as long as it is not quite clear what the OP exactly wants, it is a bit difficult to advise one of the different ways to use NFS, let alone which parameters to use.

BTW systemd has it’s own way of doing the same as automounter. Looks more easy to configure. Something I want to try out.