[SOLVED] NFS access denied by server while mounting
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to mount my server NFS share on my laptop. Both are running Debian. The server IP address is 192.168.0.69 and the laptop IP address is something like 192.168.0.100 (assigned by DHCP). When I do
Code:
sudo mount -t nfs 192.168.0.69:/media/nfs/ /home/laptop/nfs/
I get this error:
Code:
mount.nfs: access denied by server while mounting 192.168.0.69:/media/nfs/
I did not know about #exportfs -a. When I try using that with my configuration (or if I add the no_squash_root option), I get this message:
Code:
exportfs: /etc/exports:1: unknown keyword "hard"
The "hard" option should be valid, right? What does it say that it is unknown?
When following akcgi's suggestion, #exportfs -a gives this:
Code:
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.0/24:/media/nfs/".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
In both cases, when mounting on the client, I get a long wait and then this:
Code:
mount.nfs: Connection timed out
Here is /var/log/messages for the server:
Code:
Mar 14 00:33:42 server rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="972" x-info="http://www.rsyslog.com"] rsyslogd was HUPed, type 'lightweight'.
Here is /var/log/messages for the laptop (client): http://pastebin.com/riEXysvs It's on Pastebin because it's too huge.
I don't see anything relevant in those, but maybe you can.
The option hard is used during the mount, i.e. on the client side. Either on the command line or in /etc/fstab.
Is anything blocked in /etc/hosts.allow resp. /etc/hosts.deny?
NB: Don’t use a blank between the network address (i.e. the host specification) and the option list, this will generate two separate entries: one without any options for the mentioned address (and the default will be used), and one with the options for all other machines around there (as an limiting address is missing).
NB2: The wildcard is to be used with domain names, not with addresses IIRC.
My hosts files are empty except for comment lines beginning with #. This should make the server open to all hosts by default, correct?
I also removed the option intr from the server exports file. I'm using my laptop's current IP address, 192.168.0.105 in case the IP address wildcard was causing an issue. I accidentally wrote "no_squash_root" instead of "no_root_squash", so I fixed that. This is my exports file:
Code:
/media/nfs/ 192.168.0.105(ro,sync,no_root_squash)
I'm mounting with this command:
Code:
#sudo mount -t nfs -o hard,intr 192.168.0.69:/media/nfs/ /home/laptop/nfs/
(on server)
# /etc/init.d/portmap restart
Stopping portmap daemon....
Starting portmap daemon....
# /etc/init.d/portmap status
portmap is running.
I gave my laptop a static IP, 192.168.0.13, to make this more simple. I used exportfs -a and restarted the nfs server service.
Code:
(on laptop)
# mount -t nfs -v 192.168.0.69:/media/nfs/ /home/laptop/nfs/
mount.nfs: timeout set for Fri Mar 16 01:57:53 2012
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.69,clientaddr=192.168.0.13'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.0.69:/media/nfs/
There isn't much in the messages related to NFS, so I grep'd it. Nothing comes up immediately when I try mounting the share.
Code:
(on laptop)
# cat /var/log/messages|grep nfs
Mar 13 21:39:37 debian kernel: FS-Cache: Netfs 'nfs' registered for caching
Mar 13 21:39:37 debian kernel: Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Mar 15 01:33:00 debian kernel: FS-Cache: Netfs 'nfs' registered for caching
Mar 15 01:33:00 debian kernel: Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Mar 15 23:51:12 debian kernel: FS-Cache: Netfs 'nfs' registered for caching
Mar 15 23:51:12 debian kernel: Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
# cat /var/log/messages|grep NFS
Mar 13 21:39:37 debian kernel: RPC: Registered tcp NFSv4.1 backchannel transport module.
Mar 15 01:33:00 debian kernel: RPC: Registered tcp NFSv4.1 backchannel transport module.
Mar 15 23:51:12 debian kernel: RPC: Registered tcp NFSv4.1 backchannel transport module.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.