Mounted NFS share denies access to subdirectories
Hi all, I'm still learning the ins and outs of Linux. Right now I'm having a bit of a problem with NFS. I'm trying to access a media share called "storage" which I have setup on my main machine running Sabayon 3.4.
The NFS share mounts without complaint, but then if I do a directory listing on the mount point, I get this: Code:
$ ls -l /mnt/storage/ Code:
$ ls /mnt/storage/music Code:
/media/storage 192.168.1.0/255.255.255.0(ro) /etc/hosts.deny is denying ALL on portmap, lockd, mountd, rquotad, and statd. /etc/hosts.allow reads ALL:192.168.1.0/255.255.255.0 The server machine is running Sabayon 3.4, and the client in question has Fedora Core 5. If anyone can shed any light on this, it would be appreciated. And if there's any information I omitted which would be helpful, please let me know and I will provide it. |
the uid/gid (numerical values!) have to match for client/server
--> use chown to change the uid/gid on the server or client as needed. |
Quote:
|
There are a number of ways of dealing with this problem. The simplest, though possibly inconvenient, way is to make sure that all computers have matching uids and gids. It's also possible to use uid mapping though, through the use of ugidd, some kind of static map, or LDAP. You can read a bit more about these methods here.
|
All right, so I used usermod -u to change the UID/GID of the main user on the client to 1000:0 (to match the owner of the share on the server). Nothing seems to have changed.
EDIT: Also tried using the map_daemon option in my /etc/exports file as per your link Gethyn, which also doesn't seem to have changed anything. Do I need to be setting up the daemon elsewhere so that ugidd will work? |
you cannot (and should not) change the share from the client, as it is set read-only on the server.
basically you need to make sure that users on your client have numerical user-ids that match the ones on your server. that is text names like 'users' don't matter! example dir on the server ('ls -n'): drwxrwxr-x 40 1000 100 4096 2007-10-02 17:02 my-home-dir this folder is owned by some user with user-id: 1000 and group-id: 100 for users on the client machine to get access they need to be in a group on the client with a numerical id of 1000. those numbers can be set during group/user creation. this also poses some security issue, as anybody with root access on some nfs client can switch those numbers as desired - and gain root access to that share ! that's why you should always use something like this: /media/storage 192.168.1.0/255.255.255.0(ro,root_squash) oops. a bit late :-) are all daemons running ? portmap ? |
Quote:
The share on the server (which is owned by user "luke"): Code:
$ cat /etc/passwd | grep luke Code:
$ cat /etc/passwd | grep jukebox |
Figured it out.
The permissions on the /storage directory were set incorrectly. :p I did a chmod -r 755 and now everything works just fine. Thank you all for your help! |
All times are GMT -5. The time now is 07:59 AM. |