深度阅读

How to export an NFS share on a server?

作者
作者
2023年08月22日
更新时间
11.08 分钟
阅读时间
0
阅读量

To export an NFS share on a server, you will need to modify the /etc/exports configuration file. Here are the general steps:

  1. Identify the directory that you want to share via NFS.
  2. Add an entry to the end of the /etc/exports file that specifies the directory to share, the IP address or hostname of the client machine, and the permissions for that client to access the share. For example:
/path/to/share client_ip_address(rw,sync,no_subtree_check)

Here, rw stands for read/write access, sync specifies that data will be written to disk immediately, and no_subtree_check disables subtree checking for performance reasons. You can customize the permissions to fit your specific needs.

  1. Save the file and run the following command to export the NFS share:
sudo exportfs -a

This will export all the shares listed in the /etc/exports file.

Note that you may need to restart the NFS service (sudo systemctl restart nfs) for changes to take effect. Additionally, make sure that both the NFS service and any firewalls are properly configured to allow NFS traffic.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。