zoukankan      html  css  js  c++  java
  • [转]ubuntu11.04配置nfs--解决mount.nfs: access denied问题

    总算通过了nfs的localhost测试。

    配置很简单,下面摘自网络,并且整理下:

    1 安装nfs

    #apt-get install nfs-kernel-server

    #apt-get install nfs-common

    2 配置/etc/exports

    在文本末添加

    #/root/nfs_root *(rw,sync,no_root_squash)

    #chmod 777 -R /root/nfs_root

    可以使用showmount -e来查看当前的配置是否已经生效

    #showmount -e                     

    Export list for medea-MS-7680:

    说明还没有生效。

    使用exportfs -r 更新配置

    #exportfs -r

    #showmount -e

    Export list for medea-MS-7680:

    /root/nfs_root *

    3 启动

    #/etc/init.d/nfs-kernel-server restart    重新nfs服务

    简单吧,通过3步骤一般就可以使用nfs了。就可以使用localhost进行本地mount测试了。

    网络一般还会配置/etc/hosts.deny与/etc/hosts.allow。主要是配置ip访问的权限控制。但是我不想配置,感觉个人电脑上没有什么重要的东西。就忽略了。

    好了,我的噩梦开始了。

    #mount -t nfs localhost:/root/nfs_root /root/book

    出现了如下的提示:mount.nfs: access denied by server while mounting localhost:/root/nfs_root

    花了我3天的时间,检测。 发现在公司的电脑配置没有问题。就家里的台式机会出问题。

    网上search找不到任何原因。 郁闷了。

    后来,我尝试了重新配置/home/medea作为挂载点,发现居然通过了。

    我就到根目录下,   ls -al。总算发现问题了。原来我的/root的权限是     drwx------  43 root root  4096 2011-09-18 07:43 root

    我就想到了, 本地mount上后,会是另一种用户登录。   原来是root访问权限出问题了。

    于是:

    #chmod 755 /root 

    在尝试

    #mount -t nfs localhost:/root/nfs_root /root/book

  • 相关阅读:
    wmi
    Python中基本同步原语的使用
    Python多线程的几种实现方式
    TCP/IP详解 卷1 第一章 概述
    对利用sqlmap获取os-shell过程的一次抓包分析
    12.19 Aggregate (GROUP BY) Functions
    13.2.9 SELECT 语法
    GitHack 源码分析
    CTF遇到的问题-长期更新
    在Windows server2008中搭建sqli-lab实验环境
  • 原文地址:https://www.cnblogs.com/zhangbing12304/p/8313517.html
Copyright © 2011-2022 走看看