Problems mouninting an NFS share on CentOS 7: mount.nfs: access denied by server while mounting

12,889

The problem was in /etc/exports file on the server. Client's VM IP didn't match the server IP mask. I have allowed an access to any IP, and now I am able to mount the shares on the guest. This is the new config:

/home/hedin/export   *(rw,fsid=0,insecure,no_subtree_check,async)
/home/hedin/export/eudyptula *(rw,nohide,insecure,no_subtree_check,async)
Share:
12,889

Related videos on Youtube

Roman Storozhenko
Author by

Roman Storozhenko

Email: [email protected] Skype: romeus_2009 Summary During my professional career (10+ years) I have worked in many professional domains, even as specific as low-level programming. Before the Desktop Age was over I had an opportunity to participate in an enterprise system development and some small desktop projects. Then I moved to web development domain and since that time I have made numerous web projects and learned a number of technologies. In the last few years my area of interests was shifted to cloud technologies, virtualization, storage solutions and linux kernel development. Those are my first (and I hope that not last) three patches that were accepted to the mainline Linux Kernel. You could see them in the Linus Torvalds's git repository: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=author&q=Roman+Storozhenko I am going to continue work with the kernel. I am a reliable and hard-working person. I like to solve new challenging and complex tasks. Technical Skills Languages: Python, C, C++, C# , Javascript, PHP, Pascal, Assembly language (for x86 and pic-controllers architecture) Linux-related experience: kernel: device drivers development, memory management, filesystem progamming, network-related programming userspace: command-line utilities, daemons, network, multiprocess/multithreaded-style programming, etc... in accordance with the latest version of the POSIX standard. Virtualization: Oracle VirtualBox, VmWare Workstation, Xen Hypervisor, Docker, Kvm, QEMU Cloud: OpenStack, AWS: EC2, S3, RDS, SQS, Lambda, CloudFormation, EBS, OpsWorks Deployment: Ansible Python-related experience: Celery, Eventlet, Django, Django REST Framework, Tastypie, etc... DB-related experience: MySQL, MsSQL, ORACLE HTTP-Servers: Nginx, Apache, IIS VCS: Git, Mercurial, SVN CI: Jenkins Issue tracking systems: Atlassian stack (Jira + Bitbucket + Hipchat), Redmine Favourite editor: vim Certifications August, 2014 Certificate for Introduction to Linux: https://verify.edx.org/cert/bd44a4531d814ce8a0a8c450327ea353 October, 2016 Verified Certificate for Introduction to OpenStack: https://courses.edx.org/certificates/50485cc284634b199a15fbad5d45c2d7 Volunteer Experience Member at Taganrog Linux User Group February 2011 - Present Participated as a speaker in the conference Taganrog Linux User Group 2011 http://lug.tagan.ru/lugconf Languages English, Intermediate Level: https://www.dropbox.com/s/bnixx1lwysnwujn/certificate.jpg Russian Education Taganrog State University of Radioengineering engineer, Programming, 1996 - 2004 Interests Programming, Swimming, Gym, Travel, Linux, Open Source Public Profiles Linkedin: https://ru.linkedin.com/in/romeus78 GitHub: https://github.com/Romeus

Updated on September 18, 2022

Comments

  • Roman Storozhenko
    Roman Storozhenko over 1 year

    I have Ubuntu 16.04 host with an IP address of 192.168.1.35, and two VM clients: Ddebian 8 Jessie and CentOS 7. I run nfs server on my host and nfs client on both on my guests. As of Debian guest it mounts nfs-share from host without any problem. The problem is in my CentOS guest

    When I try to mount the nfs-share from within the guest it issues the following error:

    [hedin@localhost ~]$ sudo mount -a
    mount.nfs: access denied by server while mounting 192.168.1.35:/home/hedin/export/eudyptula
    

    This is my guest's /etc/fstab:

    #
    # /etc/fstab
    # Created by anaconda on Mon Apr 10 16:16:12 2017
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/cl-root     /                       xfs     defaults        0 0
    UUID=46ddae58-4556-492c-8e23-8c56a4e067d9 /boot                   xfs     defaults        0 0
    /dev/mapper/cl-swap     swap                    swap    defaults        0 0
    192.168.1.35:/home/hedin/export/eudyptula /home/hedin/mnt/host nfs rw,hard,intr,bg 0 0
    

    Firewall is disabled:

    [hedin@localhost ~]$ systemctl is-enabled firewalld
    disabled
    

    SELinux is disabled:

    [hedin@localhost ~]$ cat /etc/sysconfig/selinux
    
    # This file controls the state of SELinux on the system.
    SELINUX=disabled
    SELINUXTYPE=targeted
    

    All hosts are allowed:

    [hedin@localhost ~]$ cat /etc/hosts.allow
    #
    # hosts.allow   This file contains access rules which are used to
    ALL: ALL: ALLOW
    

    We could see host nfs-share from within the guest:

    [hedin@localhost ~]$ sudo showmount -e 192.168.1.35
    Export list for 192.168.1.35:
    /home/hedin/export/eudyptula 192.168.1.0/24
    /home/hedin/export           192.168.1.0/24
    

    And this is my hosts's /etc/export configuration:

    hedin@home:~/projects/open-source/linux$ cat /etc/exports
    
    /home/hedin/export   192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async)
    /home/hedin/export/eudyptula 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)
    

    So, I don't know what I have missed in my configuration. Any ideas?