LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   nfs 'permission denied' (https://www.linuxquestions.org/questions/slackware-14/nfs-permission-denied-272750/)

friendly_guy 01-01-2005 08:52 PM

nfs 'permission denied'
 
I have connected two computers (both running slack 10) by ethernet cards with a crossover cable. Both machines are able to ping each other & I have checked each cards configuration with ifconfig.

I have tried to set up an nfs folder on one machine to be mounted by the other. When I type 'showmount -e localhost' the folder shows up fine on its machine but when I try to mount it on the other machine, either from the command line or via /etc/fstab I get the error message 'failed, reason given by server: Permission denied'

The firewall on each machine is turned off. I have used the * wildcard in /etc/exports so it is not a naming problem, as far as I can tell.

Nothing I have managed to read or google has sorted it. All suggestions & or further reading gratefully received.

320mb 01-01-2005 10:31 PM

What is ::

the output of rpcinfo -p servername run on the client

the output of rpcinfo -p localhost run on the server

and have you edited /etc/hosts.allow and/or
/etc/hosts.deny ???

mago 01-02-2005 11:56 AM

Hellow there, can you post the /etc/exports and the ips and the paths of the machines and folders?

Sounds to me like something really simple might be creating the problem, but the simple ones always take long time to get identified.

friendly_guy 01-02-2005 01:56 PM

Hi - thanks for the interest. Sorry if this is a long post but I am trying to provide all the information as requested. I may have missed something very basic, I have been using Linux for about one & a half years but this is the first time I have tried networking anything.

the two computers are (as in /etc/hosts):
127.0.0.2 sb.net sb (client)
127.0.0.3 lb.net lb (server)

hosts.allow is set to 'ALL:ALL' and there are no entries in hosts.deny

the /etc/exports entry on lb is:
/test *(rw,sync,no_root_squash)
and the /etc/fstab entry on sb is
lb.net:/test /in nfs noauto,user,ro 0 2
The permissions on both folders are liberal. My basic approach has been to try & allow everything & tighten up afterwards.

on sb 'rpcinfo -p lb' gives
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 998 rquotad
100011 2 udp 998 rquotad
100011 1 tcp 1001 rquotad
100011 2 tcp 1001 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32770 nlockmgr
100021 3 udp 32770 nlockmgr
100021 4 udp 32770 nlockmgr
100005 1 udp 1010 mountd
100005 1 tcp 1013 mountd
100005 2 udp 1010 mountd
100005 2 tcp 1013 mountd
100005 3 udp 1010 mountd
100005 3 tcp 1013 mountd
100024 1 udp 1016 status
100024 1 tcp 1019 status


on lb 'rpcinfo -p sb' gives
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 964 rquotad
100011 2 udp 964 rquotad
100011 1 tcp 967 rquotad
100011 2 tcp 967 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100021 1 udp 32770 nlockmgr
100021 3 udp 32770 nlockmgr
100021 4 udp 32770 nlockmgr
100005 1 udp 976 mountd
100005 1 tcp 979 mountd
100005 2 udp 976 mountd
100005 2 tcp 979 mountd
100005 3 udp 976 mountd
100005 3 tcp 979 mountd
100024 1 udp 982 status
100024 1 tcp 985 status

i hope this is what was wanted - thanks again

Guy

mago 01-02-2005 02:51 PM

I do use nfs all the time and every thing looks fine to me but the * and the fact that you are using the reserved network 127.0.0.0/8 , not too sure how good the wild cards are.


Try this:

Change the IP's to something something in the 192.168.0.0/8 network.

Then on the /etc/exports set the code like this, more or less:

Code:

/test    192.168.0.2(rw,no_root_squash,sync)
(asuming that the client machine is actually 192.168.0.2), then
Code:

exportfs -a
to refresh the nfsd settings. And adjust the /etc/fstab acording to this.


Good Luck!!!!

Vincent_Vega 01-02-2005 03:00 PM

Why don't you try putting a specific entry in /etc/hosts.allow containing your actual IP address of the client.
And i think using an ip address instead of the * in /etc/exports will help too, as mentioned above.

trickykid 01-02-2005 05:05 PM

Quote:

Originally posted by 320mb
What is ::

the output of rpcinfo -p servername run on the client

the output of rpcinfo -p localhost run on the server

and have you edited /etc/hosts.allow and/or
/etc/hosts.deny ???

Permission denied has nothing to do with rpc or portmap but most likely the shares have not been exported properly especially using a 127.x.x.x type local loop type IP address. Like mentioned before, you need to use networkable IP addresses in order for your nfs shares to work and export properly.

friendly_guy 01-02-2005 07:24 PM

Hi - I've got it working - thanks for all suggestions.

Changing the addressed from 127* to 192.168* addresses made a difference. Strangely enough, after that I also had to create an /etc/exports entry for the client machine and reboot to get RPC working. After that both machines can mount each others 'shared' directory.


All times are GMT -5. The time now is 09:33 PM.