Permissions error with NFS
I am having a bit of an issue with a NFS configuration. Initially I had no issues when both the server and client were both running Ubuntu Karmic. The client is now running Fedora Core 12 and when I mount the share I get "You do not have the permissions necessary to view the contents of Mnt". I came across this troubleshooting guide and it suggests that the issue may be the UIDs are not in sync on the server and client. If this is the issue, which usernames do I need to sync and how would I do that? Thank you.
|
If you run "ls -ln", you can see your users uid & primary gid numbers quickly.
You can also examine your /etc/passwd file, or run "getent passwd <username>". If you were running as root (a bad idea) when entering the nfs share, a "rootsquash" option will have changed your uid to nobody, which may not have had permissions to read files. If you are running an NIS server, then the UID numbers can be different between machines. Another option is using ldap for authentication, which keeps the uid numbers centralized as an NIS server would. For a home user, be aware of the UID number ranges that your distros use and keep them the same. Also look at the /etc/login.defs file. It is where these ranges are defined. Code:
# On the new distro, modify your UID & GID entry in /etc/passwd, and use chown to change your files' UID & GID numbers: sudo find /home/<username> /tmp/ /var/ -user <old_uid> -exec chown <newuid> '{}' \; sudo find /home/<username> /tmp/ /var/ -group <old_gid> -exec chgrp <new_gid> '{}' \; You can also use "usermod" to change your UID. Reboot after making the changes. Linux uses setfacl on devices to grant you access. It would be best to reboot to clean things up. You could delete the files in /tmp just before rebooting to clean it out instead of changing the UID & GID of user files in it. |
Thanks. Everything is up and running correctly.
|
All times are GMT -5. The time now is 08:31 PM. |