LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 10-09-2011, 05:00 PM   #1
royce2020
Member
 
Registered: Jan 2003
Posts: 92

Rep: Reputation: 16
Unhappy Access denied for NFS - but hosts.allow and hosts.deny seem OK


I have a server running IPFire that is running our internet, and also running a PXE boot server. The end result of this is that we will be able to boot Ubnutu over the network, but it needs NFSv4 to work.
The IPfire addon documentation for NFS is simple to the extreme and claims it should just work. Which it doesn't.

The contents of the /etc/exports file:

/mnt/sdb1 10.10.0.0/24(rw,async,subtree_check,no_root_squash)

the contents of the /etc/hosts.allow file:

sshd : ALL
ALL : localhost
ALL : 10.10.0.0/255.255.0.0

the contents of the /etc/hosts.deny file:

ALL:ALL

The way I read that is that any machine with an ip address starting 10.10 should always be allowed access.
Also, after a little googling I discovered that sometimes, an NFS server will act oddly if the remote user doesn't have local access to the folder you're mounting, so I changed the folders group to 'nobody' and run 'chmod 777' on it (not exactly security conscious, but I'll fix that later).

Howerver, every time I run 'mount 10.10.10.1:/mnt/sdb1/tftpboot/ /mnt/nfs' on a client (which has the ip 10.10.10.111) I get: ' access denied by server while mounting 10.10.10.1:/mnt/sdb1/tftpboot'

'rpcinfo -p' (on the client and the server) reports that port 2049 is open and NFS is listening on it, and I can telnet to that port (meaning the firewall isn't interfering with it).
I have tried restarting the nfs-server daemon on the server, and it does restart, but when it's stopping the NFS-statd daemon it reports "FAILED", although it starts correctly. I don't know if that makes any difference.

Any thought on this would be appreciated.
 
Old 10-09-2011, 10:46 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,388

Rep: Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764Reputation: 2764
Have you seen the "Linux NFS-HOWTO"? You may have a local copy, otherwise here is a link. http://nfs.sourceforge.net/nfs-howto/
Chapter 3 details the configuration for a server.
 
Old 10-09-2011, 11:43 PM   #3
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
The way I see your configuration files

The entry you have made in hosts.deny says that you are denying the access of all the machines except the one you have mentioned in your hosts.allow file


but your hosts.allow file seems to be incomplete

You need to mention the services and the hosts which are allowed to use those services through your machine

Code:
#vi /etc/hosts.allow

sshd : ALL
ALL : localhost

lockd: 10.10.10.111 
rquotad: 10.10.10.111
mountd: 10.10.10.111 
statd: 10.10.10.111
portmap: 10.10.10.111

try running the command

Code:
#mount -t nfs 10.10.10.1:/mnt/sdb1/ /mnt/nfs
 
Old 10-17-2011, 02:46 PM   #4
royce2020
Member
 
Registered: Jan 2003
Posts: 92

Original Poster
Rep: Reputation: 16
sorry about the long wait: I've been busy with other things.

I tried your suggestion for changing the hosts.allow file, and then running "/etc/init.d/nfs-server restart" but it doesn't make any difference to the error message.

Also, replacing hosts.allow and hosts.deny with empty files and restarting the nfs-server makes no difference ether. According to the documentation I've read, this should just allow everyone by default, which it doesn't. So something else is fundamentally wrong somewhere, but I don't know what it is.

Last edited by royce2020; 10-17-2011 at 03:35 PM.
 
Old 10-17-2011, 10:44 PM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
According to your post you are sharing /mnt/sdb1 for NFS

Code:
/mnt/sdb1 10.10.0.0/24(rw,async,subtree_check,no_root_squash)

and while mounting on client machine:

Code:
mount 10.10.10.1:/mnt/sdb1/tftpboot/ /mnt/nfs
So how is your client going to access tftpboot when you have not mentioned that folder on your server?

the entry should something like this in your exports file


Code:
/mnt/sdb1/tftboot 10.10.0.0/24(rw,async,subtree_check,no_root_squash)
 
  


Reply



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
Question about NFS and /etc/hosts.{allow,deny} bonixavier Slackware 7 05-20-2011 07:39 PM
can't restrict sshd access through hosts.allow and hosts.deny but was working earlier farhan Linux - Security 4 04-18-2008 07:41 AM
/etc/hosts.deny/hosts.allow have no effect on sshd access bganesh Linux - Security 4 05-04-2006 08:06 PM
NFS security with /etc/hosts.deny supernode Linux - Security 8 10-22-2005 09:51 AM
IP still denied, after removed from hosts.deny anth2oo1 Linux - Security 13 05-06-2003 07:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:36 PM.

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