Results 1 to 10 of 12
I am having a hard time getting NFS to work on my machines. I have tried to set the server up to accept connections from mymachine and to allow me ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-31-2005 #1Linux User
- Join Date
- Jan 2005
- Location
- Florida
- Posts
- 414
NFS - permission denied.
I am having a hard time getting NFS to work on my machines. I have tried to set the server up to accept connections from mymachine and to allow me to access /home/user but when I try to mount the file I just get a message saying that the server has denied permission. Can someone suggest where I should start looking to solve this plz.
registered linux user: 387197
- 08-31-2005 #2
What does your /etc/exports file say?
It should be something like this:
[folder to export] [machine exported to](rw,sync,no_root_squash)
e.g.
/home 192.168.0.3(rw,sync,no_root_squash)
And dont forget to restart the nfs service with
service nfs restart
after you change your exports file.Linux user #126863 - see http://linuxcounter.net/
- 08-31-2005 #3Linux User
- Join Date
- Jan 2005
- Location
- Florida
- Posts
- 414
/etc/exports looks like
This is what I have been typing to try to mount the folder and the message I receive/home/jpq04 192.168.0.100(rw,sync,no_root_squash)Code:[root@spottydog jpq04]# mount -t nfs 192.168.0.101:/home/jpq04 /home mount: 192.168.0.101:/home/jpq04 failed, reason given by server: Permission denied
registered linux user: 387197
- 08-31-2005 #4Thanks for that snippet.
Originally Posted by jimbaloo
But the question I asked was about the server-side config. The server appears to be rejecting the connection, not the client (i.e. not the machine you're trying to mount the nfs partition on).
Is this filesystem exported on the server using the method I suggested? Is the nfs service running on the server? Does it have any firewal rules blocking the nfs port (I forget which port it runs on now, but I'm sure someone will be able to remind us).
There many potential reasons why this connection is being denied, but we have to narrow it down. And it is the server doing the rejecting.
Here's a tip, put that mount line into your /etc/fstab file, then you can test if it mounts using just its mount point (e.g. 'mount /home') rather than typing all that in each time.Linux user #126863 - see http://linuxcounter.net/
- 09-01-2005 #5Linux User
- Join Date
- Jan 2005
- Location
- Florida
- Posts
- 414
I have temporarily disabled the firewall on the server so there are no rules whatsoever that should be affecting the nfs service.
AfterI added the mount line to /etc/fstab it told me that there is a bad line when I typedThe line in question isCode:mount /home/jpq04
This is on the client side though, not the server.192.168.0.101:/home/jpq04 /home/jpq04 nfs nfsvers=3,rw 0 0registered linux user: 387197
- 09-01-2005 #6
Right, first I'll summarise what I think your lan looks like, then try to walk through what I think you should have in the configs at each end.
You have:
192.168.0.101 = your server (name unknown)
192.168.0.100 = linux client (called, by the looks of it, spottydog)
*On the server (192.168.0.101)*
edit /etc/exports
make sure it contains just the line (with a blank line after it):
/home/jpq04 192.168.0.100(rw,sync,no_root_squash)
and do:
service nfs restart
*On the client (192.168.0.100)*
edit /etc/fstab and add/edit the line:
192.168.0.101:/home/jpq04 /home/temp nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
make sure /home/temp exists (mkdir /home/temp)
then do:
cd /home
mount temp
This should mount the directory on temp. If it does not, then can you please post up the error that it generates.
If it does mount up ok, then you can unmount and change /etc/fstab to mount the directory to wherever you wanted it in the first place. Dont forget to remove the /home/temp mount point with rmdir.Linux user #126863 - see http://linuxcounter.net/
- 09-01-2005 #7Linux User
- Join Date
- Jan 2005
- Location
- Florida
- Posts
- 414
The client /etc/fstab now looks like this:Code:[root@spottydog home]# mount temp mount: 192.168.0.101:/home/jpq04 failed, reason given by server: Permission denied
and the server /etc/exportsCode:[root@spottydog temp]# cat /etc/fstab LABEL=/ / ext3 defaults 1 1 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 /dev/hdb3 swap swap defaults 0 0 /dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0 /dev/cdrom1 /mnt/cdrom1 udf,iso9660 noauto,owner,kudzu,ro 0 0 192.168.0.101:/home/jpq04 /home/temp nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
Code:/home/jpq04 192.168.0.100(rw,sync,no_root_squash)
registered linux user: 387197
- 09-01-2005 #8
The only difference between what you have there and what I have on my server is that my exports file says
/home 192.168.250.0/24(rw,sync,no_root_squash)
i.e. I'm allowing access for a subnet.
You mentioned about turning off your firewall, can you just double check that the port is not blocked.
Can you also double check the permissions on the /home/jpq04 directory, to make sure that there is read access by root.
nfsd is definitely running isn't it (ps ax|grep nfs)?
You could also try exporting as read-only, using (ro,insecure) to see if you can get it to mount at all.Linux user #126863 - see http://linuxcounter.net/
- 09-01-2005 #9Linux User
- Join Date
- Jan 2005
- Location
- Florida
- Posts
- 414
Here's what grep pulled up
I changed the permissions to on /home/jpq04 to 777.Code:[root@spottydog jpq04]# ps ax|grep nfs 3808 ? S 0:00 [nfsd] 3809 ? S 0:00 [nfsd] 3810 ? S 0:00 [nfsd] 3811 ? S 0:00 [nfsd] 3812 ? S 0:00 [nfsd] 3813 ? S 0:00 [nfsd] 3814 ? S 0:00 [nfsd] 3815 ? S 0:00 [nfsd] 3842 pts/1 R+ 0:00 grep nfs
registered linux user: 387197
- 09-01-2005 #10Linux User
- Join Date
- Jan 2005
- Location
- Florida
- Posts
- 414
Roxoff,
I think I have found out what the problem was. I checked /var/log/messages and found that I was having a naming conflict. I have spottydog used on both machines, but on one of them I had left it out of the other's /etc/hosts, just entering the ip instead. I added the hostname to the ip and I managed to mount the directory in /home/temp.
I really appreciate your time and patience.
Thanks
registered linux user: 387197



