加入收藏 | 设为首页 | 会员中心 | 我要投稿 辽源站长网 (https://www.0437zz.com/)- 云专线、云连接、智能数据、边缘计算、数据安全!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

centos nfs配置--转载

发布时间:2021-01-20 14:14:24 所属栏目:Linux 来源:网络整理
导读:h2 class="title"http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-nfs-client-config.html h2 class="title"18.6.?NFS Server Configuration There are three ways to configure an NFS server under Red Hat Enterprise Linux: using the ( )

Be careful with spaces in the file. If there are no spaces between the hostname and the options in parentheses,the options apply only to the hostname. If there is a space between the hostname and the options,the options apply to the rest of the world. For example,examine the following lines:


The first line grants users from read-write access and denies all other users. The second line grants users from read-only access (the default) and allows the rest of the world read-write access.

Each time you change ,you must inform the NFS daemon of the change,or reload the configuration file with the following command:





The host(s) can be in the following forms:

  • Single machine — A fully qualified domain name (that can be resolved by the server),hostname (that can be resolved by the server),or an IP address.

  • Series of machines specified with wildcards — Use the * or ? character to specify a string match. Wildcards are not to be used with IP addresses; however,they may accidentally work if reverse DNS lookups fail. When specifying wildcards in fully qualified domain names,dots (.) are not included in the wildcard. For example, includes one.example.com but does not include one.two.example.com.

  • IP networks — Use a.b.c.d/z,where a.b.c.d is the network and z is the number of bits in the netmask (for example 192.168.0.0/24). Another acceptable format is a.b.c.d/netmask,where a.b.c.d is the network and netmask is the netmask (for example,192.168.100.8/255.255.255.0).

  • Netgroups — In the format @group-name,where group-name is the NIS netgroup name.

  • NFS shares are mounted on the client side using the command. The format of the command is as follows:

     -o  : 
    

    Replace with either for NFSv2 or NFSv3 servers,or for NFSv4 servers. Replace with a comma separated list of options for the NFS file system (refer to for details). Replace with the remote host, with the remote directory being mounted,and with the local directory where the remote file system is to be mounted.

    Refer to the man page for more details.

    If accessing an NFS share by manually issuing the command,the file system must be remounted manually after the system is rebooted. Red Hat Enterprise Linux offers two methods for mounting remote file systems automatically at boot time: the file or the service.

    An alternate way to mount an NFS share from another machine is to add a line to the file. The line must state the hostname of the NFS server,the directory on the server being exported,and the directory on the local machine where the NFS share is to be mounted. You must be root to modify the file.

    The general syntax for the line in is as follows:

                            

    (编辑:辽源站长网)

    【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读