Reputation: 1071
I have two Ubuntu machines, one serving as an NFS server (Machine A) and the other as an NFS client (Machine B). I have configured the NFS server on Machine A as follows:
On Machine A:
sudo apt install nfs-kernel-server
.sudo mkdir /mnt/myshareddir
./etc/exports
file to allow access to the directory: /mnt/myshareddir *(rw,sync,no_subtree_check,no_root_squash)
.sudo systemctl restart nfs-kernel-server
.On Machine B, I have installed the fuse-nfs
binary from the fuse-nfs repository and configured it to mount the NFS server as follows:
mkdir -p /home/pankaj/mymountdir
.fuse-nfs
command: fuse-nfs -n nfs://<nfs-server-ip>/mnt/myshareddir -m /home/pankaj/mymountdir
.However, I am able to mount the NFS server without being prompted to enter credentials. I would like to configure the system to prompt for credentials every time I mount the NFS server. Has anyone encountered a similar issue or have any suggestions to resolve this? Am I missing something here?
I appreciate your help in advance. Thank you.
Upvotes: 0
Views: 110
Reputation: 767
NFS does not authenticate using credentials such as user and password. It restricts access based on client IP address*. Meaning you authenticate by your machine IP, not which user are you.
You have defined the IP restriction as *
meaning "no restriction" (any IP).
See similar question Mount network share with nfs with username / password.
*You can also authenticate to nfsv4 using Kerberos - a very complicated setup is required.
Upvotes: 2