As a web server administrator working on Debian systems, you may come across the error ‘Bad owner on NFS mount’, while attempting to access a directory on a remote machine. Normally, this issue happens when the remote device is not adequately configured with access control. In this post, I will explain the issue and how to use the Unix ‘df’ command to fix it.
Before going into the technical details of the underlying problem, let’s perform a simple check to be sure the remote device is up and running. To do this, type the command ‘df’ and hit enter. You should see an output of file system information such as the device name, disk capacity, number of inodes, etc. Positive output indicates that the remote server is online, and we can now look into solving the ‘Bad owner on NFS mount’ issue.
At the heart of this problem lies the standard Linux access control that restricts access to certain directories and files based on user privileges. Under normal circumstances, a user lacking the proper privileges will not have access to a directory or file while attempting to perform some task. In order to resolve this error, one will need to check the ‘owners’ of the directories and files of the remote device.
To check the ownership of the directories and files of the remote device, type the command ‘df -i’ and hit enter. The output should show the owner of each directory or file listed. If the ownership is displayed as ‘-’, then you will need to change the ownership before the ‘Bad owner on NFS mount’ error can be solved.
To change the ownership of a directory or file, type the command and hit enter ‘chown ’, replacing with the username of the new owner of the remote directory or file and replacing with the full path of the file of directory you wish to change ownership of.
When changing the ownership of a directory or file of the remote device, you will be asked for the new user’s password. Once entered, the ownership of the directory or file should be changed and the ‘Bad owner on NFS mount’ error should no longer appear when attempting to access it.
In summary, the ‘Bad owner on NFS mount’ error is filed when attempting to access a directory or file on an improperly configured remote machine. To solve this issue, you may use the Unix ‘df’ command to check the ownership of the file system, and the Unix ‘chown’ command to change the ownership to the necessary user. You should then no longer have problems attempting to access the remote device.