LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-02-2010, 01:31 PM   #1
amishtechie
Member
 
Registered: Apr 2004
Distribution: Pop OS
Posts: 130

Rep: Reputation: 17
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.

Last edited by amishtechie; 01-02-2010 at 04:19 PM.
 
Old 01-02-2010, 01:50 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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:
#
# Min/max values for automatic uid selection in useradd
#
# SYSTEM_UID_MIN to SYSTEM_UID_MAX inclusive is the range for
# UIDs for dynamically allocated administrative and system accounts.
# UID_MIN to UID_MAX inclusive is the range of UIDs of dynamically
# allocated user accounts.
#
SYSTEM_UID_MIN            100
SYSTEM_UID_MAX            499
UID_MIN                  1000
UID_MAX                 60000

#
# Min/max values for automatic gid selection in groupadd
#
# SYSTEM_GID_MIN to SYSTEM_GID_MAX inclusive is the range for
# GIDs for dynamically allocated administrative and system groups.
# GID_MIN to GID_MAX inclusive is the range of GIDs of dynamically
# allocated groups.
#
SYSTEM_GID_MIN            100
SYSTEM_GID_MAX            499
GID_MIN                  1000
GID_MAX                 60000
SuSE Linux starts UID numbers (UID_MIN) at 1000 whereas Fedora and Mandriva for example start at 500. When I installed Fedora on my netbook, I changed UID_MIN and GID_MIN to match.

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.
 
1 members found this post helpful.
Old 01-02-2010, 04:20 PM   #3
amishtechie
Member
 
Registered: Apr 2004
Distribution: Pop OS
Posts: 130

Original Poster
Rep: Reputation: 17
Thanks. Everything is up and running correctly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permissions error while copying files on NFS, but only on some files caggles Linux - Networking 1 07-30-2009 03:17 PM
NFS error: sometimes unable to find the files at NFS-client machines samengr Linux - Server 0 09-01-2008 11:26 AM
NFS Error during PXE Boot from NFS server JatMan Linux - Enterprise 0 10-16-2006 05:48 PM
NFS - can't mount - permissions denied error mchitsquad Mandriva 2 09-01-2003 05:23 PM
NFS Permissions aqoliveira Linux - General 0 01-10-2002 02:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration