Click to See Complete Forum and Search --> : NFS permissions issues


blood-stone
07-15-2002, 08:12 AM
I recently setup two linux systems, using the mandrake 8.2 distro. I had setup NFS to share out one directory to the other server. Everything worked great until I had to reboot both systems. Now I can't get them to connect, I keep getting permission errors on the client side. I have followed a 'how to' and everything seems to be working asccording to the document. Im getting to the point where I may just rebuild each 'system' and start over, while this may solve the problem, I lothe to rebuild a box when I really don't need to. So if anyone has any suggestions.
the exports on the 'server' are sharing out the directory and both machines are on the network and can see each other.

cowanrl
07-15-2002, 12:55 PM
You need to assign directory and file permissions on the NFS server for the users on the NFS client. If user1 on the client wants to access a directory or file on the server, he would need the same permissions assigned just as though the directory and files existed on the clients local machine.
Obviously you would need an account for user1 on both machines. What can be a problem is that Linux checks for file permissions based on the uid, not the user name. If user1's account on the server has a uid of 501 but user1's account on the client has a uid of 502, user1 will not be able to access directories and files he has been assigned permissions to on the server.
If your user accounts have different uids on the client machine and server, you can get around this by either recreating your user accounts and manually assinging them uids or using what is known as a map file.

The line in the exports file on the server would look something like this:

/home anyserver(rw,map_static=/etc/anyserver.map)

The contents of /etc/anyserver.map would look something like this:

uid 501 504
uid 503 503
uid 502 505

The first column is the client, the second column is the server. This is a lot easier than recreating all of your user accounts.

blood-stone
07-15-2002, 03:23 PM
I will check when I get home, the suggestion.

Both machines were build at the same time, and have the same UID 501, I do have a problem using the mount command from the client side, I have to use it as root. Is this a permissions issue with mount? Its really weird because I had it working great at one point, but after a reboot of both machines, its not working anymore, even after double checking the setup, for both the client and the server.

cowanrl
07-15-2002, 09:19 PM
Don't forget that you need to have the proper permissions set up on the server and the mount point on the client machine.

You could post your exports file from the server here. They are usually pretty simple but you can sometimes look at them over and over and not pick up an error that someone else will see right away(the voice of experience).

Normally root is the only user that can use mount. I'm not sure if you can change that or not.

blood-stone
07-15-2002, 09:44 PM
its just one line

/usr/local/games/nwn/servervault 192.168.123.200(rw)

blood-stone
07-18-2002, 03:15 PM
If root has to mount the file system from the remote computer, could it be passing the wrong ID(root and not 501)? Also since I am using root to mount on the client side, doesn't that give me rights to the mount point by default? Its acutally not something I can test at the moment since the client machine decided to take a hiatus and not work anymore. *sigh* if its not one thing, its something else.....

cowanrl
07-18-2002, 09:35 PM
On the machine I'm typing this on, I'm using NFS to mount my home directory which resides on a server. The actual mount is performed in the /etc/fstab file.
When I change to the root user on this machine, it does not have access to my home directory. I get an access denied error when I try to access my home directory as root.
However, on the server where my home directory resides, root has access to my home directory even though the home directories show exactly the same permissions on both the client and server.

It looks like the user root will not always have access to an NFS share unless it is explicitly given permissions via the root user, root group or by means of "others"