LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-22-2005, 10:40 AM   #1
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Rep: Reputation: 15
Mounting an nfs share - Permission Denied


I use nfs to share files between Linux machines on our work network. I thought I understood how it worked but I guess not.

Here is a line from /etc/exports of the server machine:

/home/media/kennels 192.168.0.*(rw)

Now there are two machines on our network that already use this share with no problems but I have just setup a new machine that gives this error when I try to mount it:

mount: 192.168.0.69:/home/media/kennels failed, reason given by server: Permission denied

Why would the server allow some machines on our network access but not others? This is the log from the server:

May 22 16:29:09 localhost mountd[2601]: Unauthorized access by NFS client 192.168.0.86.
May 22 16:29:09 localhost mountd[2601]: Blocked attempt of 192.168.0.86 to mount /home/media/My Documents (Networked)/Kennels

And this is the relevent line from the client machines /etc/fstab:

192.168.0.69:/home/media/kennels /mnt/kennels nfs rw 0 0

I don't understand. NFS seemed to simple. I can get around this by naming the machine specifically in the /etc/exports file but I don't want to have to do this every time a machine is added to the network and I would like to better understand how NFS works.

Can anyone tell me what's going on?
 
Old 05-22-2005, 11:08 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
run "exportfs" on the server, is it listed there? if not restart nfsd and look again. you might find it works with an alternative (nicer) network definition, i.e. 192.168.0.0/24. reading directly from the "exports" manpage
Quote:
Wildcard characters generally do not work on IP addresses, though they may work by accident when reverse DNS lookups fail.
did you read that?

Last edited by acid_kewpie; 05-22-2005 at 11:12 AM.
 
Old 05-23-2005, 05:01 AM   #3
doctorwebbox
Member
 
Registered: Jun 2003
Location: Rotherham, South Yorkshire, England
Distribution: Debian
Posts: 117

Original Poster
Rep: Reputation: 15
Still no good

Thanks for the advice, but strill no joy. I have tried changing the /etc/exports line in question to:

/home/media/animal 192.168.0.0/100(ro)

The IP of the client is 192.168.0.86 so I guess it should qualify but I still am getting refused. There is no exportfs command on the server so I have been using /etc/init.d/nfs-user-server restart instead. Should this work? Also is it a problem restarting the nfs server while other clients are still connected? Also would it be a problem if the client software was more up-to-date than the server software?

Any more ideas?
 
Old 05-23-2005, 09:30 AM   #4
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,270

Rep: Reputation: 119Reputation: 119
Quote:
/home/media/animal 192.168.0.0/100(ro)
That's not correct, you should use '24' not '100',
Code:
/home/media/animal 192.168.0.0/24(ro)
The number after the slash tells how many digits to use for networkadress, use '24' and all computers in 192.168.0.0 (=range 192.168.0.1 - 192-168-0-254) are allowed.
 
Old 05-28-2005, 07:19 AM   #5
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
Quote:
Originally posted by pingu
That's not correct, you should use '24' not '100',
Code:
/home/media/animal 192.168.0.0/24(ro)
The number after the slash tells how many digits to use for networkadress, use '24' and all computers in 192.168.0.0 (=range 192.168.0.1 - 192-168-0-254) are allowed.
Now I'm confused; how does 192.168.0.1 to 192.168.0.254 map onto 24 digits? Surely this is eight digits, even in binary (three in decimal, or two in hex). And what about 192.168.0.255 (which, IIRC, is what Windows XP always calls its network interface if it thinks it's the default internet gateway)?

As I work it out, /24 would match addresses 192.0.0.1 through 192.255.255.255 inclusive (assuming that this is the number of binary digits). Don't you want /8 here?

/100 would match every possible IPv4 address (and even every 64-bit IPv6 address), assuming that it didn't just ignore it as being out of range.
 
Old 05-30-2005, 01:45 AM   #6
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,270

Rep: Reputation: 119Reputation: 119
Quote:
As I work it out, /24 would match addresses 192.0.0.1 through 192.255.255.255 inclusive (assuming that this is the number of binary digits). Don't you want /8 here?
You got the idea, only count from left - /8 gives 192.0.0.1 through 192.255.255.255.
Quote:
And what about 192.168.0.255
You are completely right, I chose to only give range of valid IP's for computers. .255 is broadcast adress, used for eg DHCP-calls. And .0 is the network, thus you should never use .0 or 255 (like 192.168..0.0 or 192.168.0.255) for computers (in very special configs you can do that, don't try it.)

You have a maximum of 4x8 binary digits, /100 is out of range and doesn't work - network part of adress must be known.
 
  


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
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
NFS :: Permission denied after mounting, root works.. Devils_Guardian Linux - Networking 1 11-17-2004 10:40 AM
NFS mounting : Permission denied Bahador Linux - Networking 3 07-18-2003 04:33 AM
NFS Problem mounting 2 systems:Permission Denied by server meng_en Linux - General 3 09-23-2002 11:24 PM
permission denied when mounting nfs directory keirobyn Linux - Networking 3 01-29-2002 12:43 AM


All times are GMT -5. The time now is 09:51 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration