Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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.
  1. #1
    Linux 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

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,809
    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/

  3. #3
    Linux User
    Join Date
    Jan 2005
    Location
    Florida
    Posts
    414
    /etc/exports looks like
    /home/jpq04 192.168.0.100(rw,sync,no_root_squash)
    This is what I have been typing to try to mount the folder and the message I receive
    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

  4. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,809
    Quote Originally Posted by jimbaloo
    /etc/exports looks like
    /home/jpq04 192.168.0.100(rw,sync,no_root_squash)
    This is what I have been typing to try to mount the folder and the message I receive
    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
    Thanks for that snippet.

    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/

  5. #5
    Linux 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 typed
    Code:
    mount /home/jpq04
    The line in question is
    192.168.0.101:/home/jpq04 /home/jpq04 nfs nfsvers=3,rw 0 0
    This is on the client side though, not the server.
    registered linux user: 387197

  6. #6
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,809
    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/

  7. #7
    Linux User
    Join Date
    Jan 2005
    Location
    Florida
    Posts
    414
    Code:
    [root@spottydog home]# mount temp
    mount: 192.168.0.101:/home/jpq04 failed, reason given by server: Permission denied
    The client /etc/fstab now looks like this:
    Code:
    [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
    and the server /etc/exports
    Code:
    /home/jpq04                    192.168.0.100(rw,sync,no_root_squash)
    registered linux user: 387197

  8. #8
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,809
    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/

  9. #9
    Linux User
    Join Date
    Jan 2005
    Location
    Florida
    Posts
    414
    Here's what grep pulled up
    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
    I changed the permissions to on /home/jpq04 to 777.
    registered linux user: 387197

  10. #10
    Linux 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

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •